diff --git a/src/mlpack/core/optimizers/bigbatch_sgd/bigbatch_sgd_impl.hpp b/src/mlpack/core/optimizers/bigbatch_sgd/bigbatch_sgd_impl.hpp index ca0855a458..4375e580c4 100644 --- a/src/mlpack/core/optimizers/bigbatch_sgd/bigbatch_sgd_impl.hpp +++ b/src/mlpack/core/optimizers/bigbatch_sgd/bigbatch_sgd_impl.hpp @@ -143,7 +143,7 @@ double BigBatchSGD::Optimize( if (batchOffset <= 0) batchOffset = 1; - if (batchSize + batchOffset >= numFunctions) + if ((currentFunction + batchSize + batchOffset) >= numFunctions) break; // Update the stochastic gradient estimation.