Model

BlockOpt.ModelType

Model

Specifies the unconstrained program for minimizing a smooth objective function.

A model is constructed with a name and may be incrementally loaded. Once a model is loaded, the model becomes final, meaning the objective and gradient function may no longer be modified. A model creates a directory storing logged information throughout the model life. The model's directory is found relative to the user's current working directory, identified by the models name used as the relative portion of the directory path.

source

Interface

BlockOpt.nameFunction
name(m::Model)

Access the name associated with model m, as assigned during the construction of m.

source
BlockOpt.objectiveFunction
objective(m::Model)

The objective function of model m, having an unassigned default value of missing.

See objective! to load a model's objective.

source
BlockOpt.gradientFunction
gradient(m::Model)

The gradient function of model m, having an unassigned default value of missing.

See gradient! to load a m's gradient.

source
BlockOpt.initial_iterateFunction
initial_iterate(m::Model)

The initial iterate of model m, having an unassigned default value of missing. Setting the initial iterate of a model assigns the model a dimension.

See initial_iterate! to load m's starting location.

source
BlockOpt.formulaFunction
formula(m::Model)

The formula of model m, having an unassigned default value of missing.

See formula! to set m's formula.

source
BlockOpt.dimensionFunction
dimension(m::Model)

The dimension of model m which is set by specifying an initial iterate.

See: initial_iterate!

source
BlockOpt.objective!Function
objective!(m::Model, f)

Assign model m the objective function f.

If the model is final, the objective! call simply returns without modifying the model.

source
BlockOpt.gradient!Function
gradient!(m::Model, ∇f!)

Assign model m the in-place gradient function ∇f!, of the form

∇f!(out, x) = (out .= ∇f(x))

where ∇f(x) is the steepest descent direction at x in stored the place of the inputed buffer out.

If the model is final, the gradient! call simply returns without modifying the model.

source
BlockOpt.formula!Function
formula!(m::Model, f)

Assign model m an escaped $\LaTeX$ string represents m's objective function. The formula is used to create visual plots showing a simulation trace of m.

Example

julia> dot_formila = "$ f(x) = x⋅x $"; 
julia> formula!(m, dot_formila);

Here, the euclidean squared distance formula now represents m's objective formula.

source
BlockOpt.objFunction
obj(m::Model, x)

Evaluate the objective function of model m at x.

source
BlockOpt.grad!Function
grad!(m::Model, out, x)

Evaluate the in-place gradient function of model m at x, storing the steepest descent direction in the place of the passed input buffer out.

source
BlockOpt.hessADFunction
hessAD(m::Model, x)

The dense Hessian matrix of model m's objective function at the point x. The computation uses the ForwardDiff.jacobian forward-mode AD routine on the model's gradient function.

source
BlockOpt.hess_sampleFunction
hess_sample(m::Model, x, dx)

The hessian vector-product of model m's objective function at the point x with the vector dx. The gHS routine uses a more effiecient scheme to compute the hessian samples with ForwardDiff's Dual numbers.

source