OptimizationLogic

scalation.optimization.quasi_newton.OptimizationLogic

The OptimizationLogic trait specifies the requirements for the logic to be used in each step of a L-BFGS variable minimization done by the lbfgsMain method of the LBFGS object. The methods provided in this trait are called directly by the code used by the LBFGS class.

Classes mixing in this trait must implement two methods: evaluate and progress. The evaluate method is used to evaluate the gradients and objective function for a given state of the variables. The progress method is used to report on how the minimization process is progressing.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Concrete methods

def progress(instance: Any, x: VectorD, g: VectorD, fx: Double, xnorm: Double, gnorm: Double, step: Double, n: Int, k: Int, ls: Int): LBFGSReturnCode

Receives the progress of each iteration of the optimization process. Can be used to display or record said progress and to determine if the optimization should continue or be cancelled. A default implementation is provided to just print the contents of the current iteration of the optimization.

Receives the progress of each iteration of the optimization process. Can be used to display or record said progress and to determine if the optimization should continue or be cancelled. A default implementation is provided to just print the contents of the current iteration of the optimization.

Value parameters

fx

Current value of the objective function.

g

VectorD with the current value of the gradient vector.

gnorm

Euclidean norm of the gradient vector.

instance

an optional user data segment that may be provided when calling the LBFGS.lbfgsMain method and may have Any type, but must be the same type used by the evaluate method of classes extending this trait. Note, has type MemorySegmentin OptimizationLogicC.

k

Iteration count.

ls

The number of evaluations called for this iteration.

n

The number of variables.

step

Step used by the line search routine in this iteration.

x

VectorD with the current values of the variables.

xnorm

Euclidean norm of the variables.

Attributes

Returns

int Determines if optimization should continue. Zero continues optimization. Non-zero values cancel the optimization.

Inherited and Abstract methods

def evaluate(instance: Any, x: VectorD, n: Int, step: Double): LBFGSVarEvaluationResults

Evaluates the gradients and objective function according to the state of the variables during the minimization process.

Evaluates the gradients and objective function according to the state of the variables during the minimization process.

Value parameters

instance

an optional user data segment that may be provided when calling the LBFGS.lbfgsMain method (@see OptimizationLogic)

n

the number of variables

step

current step chosen by the line search routine.

x

VectorD with the current values of the variables

Attributes

Returns

LBFGSVarEvaluationResults, results obtained from evaluating the variables

Inherited from:
EvaluationLogic