|
My Project
|
Base class for Full Batch Minimizers. More...
#include <full_batch_minimizer.hpp>


Public Member Functions | |
| virtual | ~FullBatchMinimizer ()=default |
| virtual V | solve (V x, VecFun< V, double > &f, GradFun< V > &Gradient)=0 |
| Performs optimization. More... | |
| virtual void | setInitialHessian (const M &) |
| Sets the initial Hessian approximation (if applicable). More... | |
| virtual void | setHessian (const HessFun< V, M > &) |
| Sets the Hessian function (for Second Order methods). More... | |
| template<auto LossFn, typename DataType > | |
| V | solve_with_enzyme (V x, DataType *data) |
| Helper to solve directly using an Enzyme-compatible raw function. More... | |
| void | setMaxIterations (int max_iters) |
| Sets the maximum number of iterations. More... | |
| void | setMaxLineIters (int max_line) |
| Sets the maximum number of iterations for the line search. More... | |
| void | setArmijoMaxIter (int max_armijo) |
| Sets the maximum iterations for Armijo condition check (alias for setMaxLineIters). More... | |
| void | setTolerance (double tol) |
| Sets the tolerance for convergence. More... | |
| unsigned int | iterations () const |
| Returns the number of iterations performed. More... | |
| double | tolerance () const |
| Returns the tolerance used. More... | |
| void | setRecorder (::IterationRecorder< CpuBackend > *recorder) |
| Attach a recorder for loss/grad history. More... | |
Protected Member Functions | |
| double | line_search (V x, V p, VecFun< V, double > &f, GradFun< V > &Gradient) |
| Backtracking Line Search satisfying Wolfe Conditions. More... | |
Protected Attributes | |
| unsigned int | _max_iters = 1000 |
| unsigned int | _iters = 0 |
| double | _tol = 1e-10 |
| ::IterationRecorder< CpuBackend > * | recorder_ = nullptr |
| Optional recorder for diagnostics. More... | |
| double | c1 = 1e-4 |
| double | c2 = 0.9 |
| double | rho = 0.5 |
| double | max_line_iters = 50 |
Base class for Full Batch Minimizers.
Implements common functionalities such as Line Search for deterministic optimization.
|
virtualdefault |
|
inline |
Returns the number of iterations performed.
|
inlineprotected |
Backtracking Line Search satisfying Wolfe Conditions.
| x | Current position. |
| p | Search direction. |
| f | Objective function. |
| Gradient | Gradient function. |

|
inline |
Sets the maximum iterations for Armijo condition check (alias for setMaxLineIters).
| max_armijo | Maximum iterations. |
|
inlinevirtual |
Sets the Hessian function (for Second Order methods).
| hessFun | Function to compute the Hessian. |
Reimplemented in cpu_mlp::Newton< V, M >.
|
inlinevirtual |
Sets the initial Hessian approximation (if applicable).
| hess | Initial Hessian matrix. |
Reimplemented in cpu_mlp::BFGS< V, M, Solver >.
|
inline |
Sets the maximum number of iterations.
| max_iters | Limit on iterations. |
|
inline |
Sets the maximum number of iterations for the line search.
| max_line | Maximum line search iterations. |
|
inline |
Attach a recorder for loss/grad history.
| recorder | Recorder instance (may be null). |
|
inline |
Sets the tolerance for convergence.
| tol | Tolerance value (gradient norm). |
|
pure virtual |
Performs optimization.
| x | Initial guess. |
| f | Objective function. |
| Gradient | Gradient function. |
Implemented in cpu_mlp::Newton< V, M >, cpu_mlp::LBFGS< V, M >, cpu_mlp::GradientDescent< V, M >, and cpu_mlp::BFGS< V, M, Solver >.

|
inline |
Helper to solve directly using an Enzyme-compatible raw function.
| LossFn | The raw C++ function pointer for the loss . |
| DataType | The type of the data structure passed to the loss. |
| x | Initial parameter vector. |
| data | Pointer to the data structure. |

|
inline |
Returns the tolerance used.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Optional recorder for diagnostics.
|
protected |