Class Optimizer
Basic optimization class that is to be inherited by all the optimization classes.
The basic class used for optimization routines.
Methods
Optimizer:new ([max_dF=0.1[, tolerance=0.02]]) | Instantiating a new Optimizer object, this is a child-class and all inherited parents should call this function. |
Optimizer:initialize (tbl) | Initialization routine for all optimizers |
Optimizer:reset () | Reset default variables, such as the number of iterations |
Optimizer:iteration () | Query number of iterations this method has runned |
Optimizer:optimized ([G]) | Check whether the optimization routine has been optimized such that the maximum vector norm of the gradient is below a given tolerance. |
Methods
- Optimizer:new ([max_dF=0.1[, tolerance=0.02]])
-
Instantiating a new Optimizer object, this is a child-class
and all inherited parents should call this function.
Parameters:
- max_dF number the maximum change in parameters allowed (default 0.1)
- tolerance number maximum norm of the gradient that is allowed to converge (default 0.02)
Usage:
Optimizer{<field1 = value>, <field2 = value>}
- Optimizer:initialize (tbl)
-
Initialization routine for all optimizers
Parameters:
- tbl
- Optimizer:reset ()
- Reset default variables, such as the number of iterations
- Optimizer:iteration ()
-
Query number of iterations this method has runned
Returns:
-
number of iterations this optimization method has runned
- Optimizer:optimized ([G])
-
Check whether the optimization routine has been optimized
such that the maximum vector norm of the gradient is below
a given tolerance.
if
G
isnil
, it returns the last status of this function call.Parameters:
- G Array the gradient to check for convergence (optional)
Returns:
-
a boolean of whether the gradient is below the tolerance