From c35e78e4895b0352c27dc5c063a1694083cc4625 Mon Sep 17 00:00:00 2001 From: Marcus Edel Date: Thu, 18 Nov 2021 22:24:23 -0500 Subject: [PATCH] SCD partial gradient test fix (#332) --- HISTORY.md | 2 ++ tests/scd_test.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/HISTORY.md b/HISTORY.md index b29f02cc2..882c72be3 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -6,6 +6,8 @@ * Fix potential infinite loop in CMAES ([#331](https://github.com/mlpack/ensmallen/pull/331)). + * Fix SCD partial gradient test + ([#332](https://github.com/mlpack/ensmallen/pull/332)). ### ensmallen 2.18.0: "Fairmount Bagel" ###### 2021-10-20 diff --git a/tests/scd_test.cpp b/tests/scd_test.cpp index 7cc5bd252..fa415942e 100644 --- a/tests/scd_test.cpp +++ b/tests/scd_test.cpp @@ -196,7 +196,7 @@ TEST_CASE("SoftmaxRegressionFunctionPartialGradientTest", "[SCDTest]") // Create random class labels. arma::Row labels = arma::randi >( - points, arma::distr_param(0, numClasses)); + points, arma::distr_param(0, numClasses - 1)); // 2 objects for 2 terms in the cost function. Each term contributes towards // the gradient and thus need to be checked independently.