3 #include "../common.hpp"
4 #include "../iteration_recorder.hpp"
15 template <
typename V,
typename M>
CPU recorder that stores loss/gradient history on host.
Definition: iteration_recorder.hpp:18
Base class for Stochastic Minimizers.
Definition: stochastic_minimizer.hpp:16
void setMaxIterations(int max_iters)
Sets the maximum number of iterations.
Definition: stochastic_minimizer.hpp:24
unsigned int _iters
Definition: stochastic_minimizer.hpp:45
unsigned int _max_iters
Definition: stochastic_minimizer.hpp:44
void setTolerance(double tol)
Sets the tolerance for convergence (full gradient norm).
Definition: stochastic_minimizer.hpp:36
::IterationRecorder< CpuBackend > * recorder_
Optional recorder for diagnostics.
Definition: stochastic_minimizer.hpp:48
void setStepSize(double s)
Sets the step size (learning rate).
Definition: stochastic_minimizer.hpp:30
void setRecorder(::IterationRecorder< CpuBackend > *recorder)
Attach a recorder for loss/grad history.
Definition: stochastic_minimizer.hpp:41
double step_size
Definition: stochastic_minimizer.hpp:47
double _tol
Definition: stochastic_minimizer.hpp:46
virtual ~StochasticMinimizer()=default