State
Types
Stopping.GenericState
— TypeType: GenericState
Methods: update!, reinit!
A generic State to describe the state of a problem at a point x.
Tracked data include:
- x : current iterate
- d [opt] : search direction
- res [opt] : residual
- current_time : time
- current_score : score
Constructors: GenericState(:: T, :: S; d :: T = _init_field(T), res :: T = _init_field(T), current_time :: Float64 = NaN) where {S, T <:AbstractVector}
GenericState(:: T; d :: T = _init_field(T), res :: T = _init_field(T), current_time :: Float64 = NaN, current_score :: Union{T,eltype(T)} = _init_field(eltype(T))) where T <:AbstractVector
Note:
- By default, unknown entries are set using
_init_field
. - By default the type of
current_score
iseltype(x)
and cannot be changed once the State is created. To have a vectorizedcurrent_score
of length n, try something likeGenericState(x, Array{eltype(x),1}(undef, n))
.
Examples: GenericState(x) GenericState(x, Array{eltype(x),1}(undef, length(x))) GenericState(x, current_time = 1.0) GenericState(x, current_score = 1.0)
See also: Stopping, NLPAtX
Stopping.ListofStates
— TypeType: list of States
Constructor:
ListofStates(:: AbstractState)
ListofStates(n :: Int, :: Val{AbstractState})
ListofStates(n :: Int, list :: Array{AbstractState,1})
ListofStates(state :: S; n :: Int = -1, kwargs...)
Note:
- If
n != -1
, then it stores at most nAbstractState
. ListofStates
recursively handles sub-list of states as the attribute list is
an array of pair whose first component is a, AbstractState
and the second component is a ListofStates
(or VoidListofStates
).
Examples: ListofStates(state)
ListofStates(state, n = 2)
ListofStates(-1, Val{NLPAtX}())
ListofStates(-1, [(state1, VoidListofStates), (state2, VoidListofStates)], 2)
Stopping.NLPAtX
— TypeType: NLPAtX
Methods: update!, reinit!
NLPAtX contains the information concerning a nonlinear optimization model at the iterate x.
min_{x ∈ ℜⁿ} f(x) subject to lcon <= c(x) <= ucon, lvar <= x <= uvar.
Tracked data include:
x : the current iterate
fx [opt] : function evaluation at x
gx [opt] : gradient evaluation at x
Hx [opt] : hessian evaluation at x
mu [opt] : Lagrange multiplier of the bounds constraints
cx [opt] : evaluation of the constraint function at x
Jx [opt] : jacobian matrix of the constraint function at x
lambda : Lagrange multiplier of the constraints
d [opt] : search direction
res [opt] : residual
current_time : time
current_score : score
evals [opt] : number of evaluations of the function
(import the type NLPModels.Counters)
Constructors: NLPAtX(:: T, :: T, :: S; fx :: eltype(T) = _init_field(eltype(T)), gx :: T = _init_field(T), Hx :: Matrix{eltype(T)} = _init_field(Matrix{eltype(T)}), mu :: T = _init_field(T), cx :: T = _init_field(T), Jx :: Matrix{eltype(T)} = _init_field(Matrix{eltype(T)}), d :: T = _init_field(T), res :: T = _init_field(T), current_time :: Float64 = NaN, evals :: Counters = Counters()) where {S, T <: AbstractVector}
NLPAtX(:: T; fx :: eltype(T) = _init_field(eltype(T)), gx :: T = _init_field(T), Hx :: Matrix{eltype(T)} = _init_field(Matrix{eltype(T)}), mu :: T = _init_field(T), current_time :: Float64 = NaN, current_score :: Union{T,eltype(T)} = _init_field(eltype(T)), evals :: Counters = Counters()) where {T <: AbstractVector}
NLPAtX(:: T, :: T; fx :: eltype(T) = _init_field(eltype(T)), gx :: T = _init_field(T), Hx :: Matrix{eltype(T)} = _init_field(Matrix{eltype(T)}), mu :: T = _init_field(T), cx :: T = _init_field(T), Jx :: Matrix{eltype(T)} = _init_field(Matrix{eltype(T)}), d :: T = _init_field(T), res :: T = _init_field(T), current_time :: Float64 = NaN, current_score :: Union{T,eltype(T)} = _init_field(eltype(T)), evals :: Counters = Counters()) where T <: AbstractVector
Note:
- By default, unknown entries are set using
_init_field
(except evals). - By default the type of
current_score
iseltype(x)
and cannot be changed once the State is created. To have a vectorizedcurrent_score
of length n, try something likeGenericState(x, Array{eltype(x),1}(undef, n))
. - All these information (except for
x
andlambda
) are optionnal and need to be update when required. The update is done through theupdate!
function. x
andlambda
are mandatory entries. If no constraintslambda = []
.- The constructor check the size of the entries.
See also: GenericState
, update!
, update_and_start!
, update_and_stop!
, reinit!
Stopping.OneDAtX
— TypeType: OneDAtX
Methods: update!, reinit!, copy
A structure designed to track line search information from one iteration to another. Given f : ℜⁿ → ℜ, define h(θ) = f(x + θ*d) where x and d are vectors of same dimension and θ is a scalar, more specifically the step size.
Tracked data can include:
- x : the current step size
- fx [opt] : h(θ) at the current iteration
- gx [opt] : h'(θ)
- f₀ [opt] : h(0)
- g₀ [opt] : h'(0)
- d [opt] : search direction
- res [opt] : residual
- current_time : the time at which the line search algorithm started.
- current_score : the score at which the line search algorithm started.
Constructors: OneDAtX(:: T, :: S; fx :: T = _init_field(T), gx :: T = _init_field(T), f₀ :: T = _init_field(T), g₀ :: T = _init_field(T), current_time :: Float64 = NaN) where {S, T <: Number}
OneDAtX(:: T; fx :: T = _init_field(T), gx :: T = _init_field(T), f₀ :: T = _init_field(T), g₀ :: T = _init_field(T), current_time :: Float64 = NaN, current_score :: T = _init_field(T)) where T <: Number
Note:
- By default, unknown entries are set using
_init_field
. - By default the type of
current_score
iseltype(x)
and cannot be changed once the State is created. To have a vectorizedcurrent_score
of length n, useOneDAtX(x, Array{eltype(x),1}(undef, n))
.
General Functions
Stopping.update!
— Functionupdate!: generic update function for the State
update!(:: AbstractState; convert = false, kwargs...)
The function compares the kwargs and the entries of the State. If the type of the kwargs is the same as the entry, then it is updated.
Set kargs convert
to true to update even incompatible types.
Examples: update!(state1) update!(state1, current_time = 2.0) update!(state1, convert = true, current_time = 2.0)
See also: GenericState, reinit!, update_and_start!, update_and_stop!
update!: generic update function for the Stopping
update!(:: AbstractStopping; kwargs...)
Shortcut for update!(stp.current_state; kwargs...)
Stopping.reinit!
— Functionreinit!: function that set all the entries at _init_field
except the mandatory x
.
reinit!(:: AbstractState, :: T; kwargs...)
Note: If x
is given as a kargs it will be prioritized over the second argument.
Examples: reinit!(state2, zeros(2)) reinit!(state2, zeros(2), current_time = 1.0)
There is a shorter version of reinit! reusing the x
in the state
reinit!(:: AbstractState; kwargs...)
Examples: reinit!(state2) reinit!(state2, current_time = 1.0)
reinit!: function that set all the entries at void except the mandatory x
reinit!(:: NLPAtX, x :: AbstractVector, l :: AbstractVector; kwargs...)
reinit!(:: NLPAtX; kwargs...)
Note: if x
, lambda
or evals
are given as keyword arguments they will be prioritized over the existing x
, lambda
and the default Counters
.
reinit!: reinitialize the meta-data in the Stopping.
reinit!(:: AbstractStopping; rstate :: Bool = false, kwargs...)
Note:
- If
rstate
is set astrue
it reinitializes the current State
(with the kwargs).
- If
rlist
is set as true the list of states is also reinitialized, either
set as a VoidListofStates
if rstate
is true
or a list containing only the current state otherwise.
For NLPStopping, rcounters
set as true also reinitialize the counters.
Missing docstring for Stopping.copy, Stopping.compress_state!, Stopping.copy_compress_state
. Check Documenter's build log for details.
Stopping.add_to_list!
— Functionadd_to_list!: add a State to the list of maximal size n. If a n+1-th State is added, the first one in the list is removed. The given is State is compressed before being added in the list (via State.copy_compress_state).
add_to_list!(:: AbstractListofStates, :: AbstractState; kwargs...)
Note:
- kwargs are passed to the compress_state call.
- does nothing for
VoidListofStates
see also: ListofStates, State.compress_state, State.copy_compress_state
Base.length
— Functionlength: return the number of States in the list.
length(:: ListofStates)
see also: print, addtolist!, ListofStates
Base.print
— Functionprint: output formatting. return a DataFrame.
print(:: ListofStates; verbose :: Bool = true, print_sym :: Union{Nothing,Array{Symbol,1}})
Note:
- set
verbose
to false to avoid printing. - if
print_sym
is an Array of Symbol, only those symbols are printed. Note that
the returned DataFrame still contains all the columns.
- More information about DataFrame: http://juliadata.github.io/DataFrames.jl
see also: add_to_list!, length, ListofStates
Stopping
Types
Stopping.GenericStopping
— TypeType: GenericStopping
Methods: start!, stop!, update_and_start!, update_and_stop!, fill_in!, reinit!, status
A generic Stopping to solve instances with respect to some optimality conditions. Optimality is decided by computing a score, which is then tested to zero.
Tracked data include:
- pb : A problem
- state : The information relative to the problem, see
GenericState
. - (opt) meta : Metadata relative to a stopping criterion, see
StoppingMeta
. - (opt) main_stp : Stopping of the main loop in case we consider a Stopping of a subproblem. If not a subproblem, then
nothing
. - (opt) listofstates : ListofStates designed to store the history of States.
- (opt) stoppinguserstruct : Contains any structure designed by the user.
Constructor: GenericStopping(:: Any, :: AbstractState; meta :: AbstractStoppingMeta = StoppingMeta(), main_stp :: Union{AbstractStopping, Nothing} = nothing, stopping_user_struct :: Any = nothing, kwargs...)
Note: Metadata can be provided by the user or created with the Stopping constructor via kwargs. If a specific StoppingMeta is given and kwargs are provided, the kwargs have priority.
Examples: GenericStopping(pb, GenericState(ones(2)), rtol = 1e-1)
Besides optimality conditions, we consider classical emergency exit: - domain error (for instance: NaN in x) - unbounded problem (not implemented) - unbounded x (x is too large) - tired problem (time limit attained) - resources exhausted (not implemented) - stalled problem (not implemented) - iteration limit (maximum number of iteration (i.e. nb of stop) attained) - main_pb limit (tired or resources of main problem exhausted)
There is an additional default constructor which creates a Stopping with a default State.
GenericStopping(:: Any, :: Union{Number, AbstractVector}; kwargs...)
Note: Keywords arguments are forwarded to the classical constructor.
Examples: GenericStopping(pb, x0, rtol = 1e-1)
Stopping.NLPStopping
— TypeType: NLPStopping
Methods: start!, stop!, update_and_start!, update_and_stop!, fill_in!, reinit!, status KKT, unconstrained_check, unconstrained2nd_check, optim_check_bounded
Specialization of GenericStopping. Stopping structure for non-linear programming problems using NLPModels.
Attributes:
- pb : an AbstractNLPModel
- state : The information relative to the problem, see GenericState
- (opt) meta : Metadata relative to stopping criterion, see
StoppingMeta
. - (opt) main_stp : Stopping of the main loop in case we consider a Stopping of a subproblem. If not a subproblem, then nothing.
- (opt) listofstates : ListofStates designed to store the history of States.
- (opt) stoppinguserstruct : Contains any structure designed by the user.
NLPStopping(:: AbstractNLPModel, :: AbstractState; meta :: AbstractStoppingMeta = StoppingMeta(), max_cntrs :: Dict = init_max_counters(), main_stp :: Union{AbstractStopping, Nothing} = nothing, list :: Union{ListofStates, Nothing} = nothing, stopping_user_struct :: Any = nothing, kwargs...)
Note:
- designed for
NLPAtX
State. Constructor checks that the State has the
required entries.
There is an additional default constructor creating a Stopping where the State is by default and the optimality function is the function KKT()
`.
NLPStopping(pb :: AbstractNLPModel; kwargs...)
Note: Kwargs are forwarded to the classical constructor.
Stopping.LAStopping
— TypeType: LAStopping
Methods: start!, stop!, update_and_start!, update_and_stop!, fillin!, reinit!, status linear\system_check, normal_equation_check
Specialization of GenericStopping. Stopping structure for linear algebra solving either
$Ax = b$
or
$min\_{x} \tfrac{1}{2}\|Ax - b\|^2$.
Attributes:
- pb : a problem using LLSModel (designed for linear least square problem, see https://github.com/JuliaSmoothOptimizers/NLPModels.jl/blob/master/src/lls_model.jl )
- state : The information relative to the problem, see GenericState
- (opt) meta : Metadata relative to stopping criterion, see
StoppingMeta
. - (opt) main_stp : Stopping of the main loop in case we consider a Stopping of a subproblem. If not a subproblem, then nothing.
- (opt) listofstates : ListofStates designed to store the history of States.
- (opt) stoppinguserstruct : Contains any structure designed by the user.
LAStopping(:: LLSModel, :: AbstractState; meta :: AbstractStoppingMeta = StoppingMeta() main_stp :: Union{AbstractStopping, Nothing} = nothing, stopping_user_struct :: Any = nothing, kwargs...)
Note:
- Kwargs are forwarded to the classical constructor.
- Not specific State targeted
- State don't necessarily keep track of evals
- Evals are checked only for pb.A being a LinearOperator
- zero_start is true if 0 is the initial guess (not check automatically)
- LLSModel counter follow NLSCounters (see initmaxcounters_NLS in NLPStoppingmod.jl)
- By default, meta.max_cntrs is initialized with an NLSCounters
There is additional constructors:
LAStopping(:: Union{AbstractLinearOperator, AbstractMatrix}, :: AbstractVector, kwargs...)
LAStopping(:: Union{AbstractLinearOperator, AbstractMatrix}, :: AbstractVector, :: AbstractState, kwargs...)
See also GenericStopping, NLPStopping, LS_Stopping, linear_system_check, normal_equation_check
Stopping.LACounters
— TypeType: LACounters
Stopping.StoppingMeta
— TypeType: StoppingMeta
Methods: no methods.
Attributes:
atol: absolute tolerance.
rtol: relative tolerance.
optimality0: optimality score at the initial guess.
tol_check: Function of
atol
,rtol
andoptimality0
testing a score to zero.tolcheckneg: Function of
atol
,rtol
andoptimality0
testing a score to zero.check_pos: pre-allocation for positive tolerance
check_neg: pre-allocation for negative tolerance
recomp_tol: true if tolerances are updated
optimality_check: a stopping criterion via an admissibility function
unbounded_threshold: threshold for unboundedness of the problem.
unbounded_x: threshold for unboundedness of the iterate.
max_f: maximum number of function (and derivatives) evaluations.
max_cntrs: Dict contains the maximum number of evaluations
max_eval: maximum number of function (and derivatives) evaluations.
max_iter: threshold on the number of stop! call/number of iteration.
max_time: time limit to let the algorithm run.
nb_of_stop: keep track of the number of stop! call/iteration.
start_time: keep track of the time at the beginning.
fail_sub_pb: status.
unbounded: status.
unbounded_pb: status.
tired: status.
stalled: status.
iteration_limit: status.
resources: status.
optimal: status.
infeasible: status.
main_pb: status.
domainerror: status.
suboptimal: status.
stopbyuser: status.
exception: status.
metauserstruct: Any
usercheckfunc!: Function (AbstractStopping, Bool) -> callback.
StoppingMeta(;atol :: Number = 1.0e-6, rtol :: Number = 1.0e-15, optimality0 :: Number = 1.0, tol_check :: Function = (atol,rtol,opt0) -> max(atol,rtol*opt0), tol_check_neg :: Function = (atol,rtol,opt0) -> -max(atol,rtol*opt0), unbounded_threshold :: Number = 1.0e50, unbounded_x :: Number = 1.0e50, max_f :: Int = typemax(Int), max_eval :: Int = 20000, max_iter :: Int = 5000, max_time :: Number = 300.0, start_time :: Float64 = NaN, meta_user_struct :: Any = nothing, kwargs...)
an alternative with constant tolerances:
StoppingMeta(tol_check :: T, tol_check_neg :: T;atol :: Number = 1.0e-6, rtol :: Number = 1.0e-15, optimality0 :: Number = 1.0, unbounded_threshold :: Number = 1.0e50, unbounded_x :: Number = 1.0e50, max_f :: Int = typemax(Int), max_eval :: Int = 20000, max_iter :: Int = 5000, max_time :: Number = 300.0, start_time :: Float64 = NaN, meta_user_struct :: Any = nothing, kwargs...)
Note:
- It is a mutable struct, therefore we can modify elements of a
StoppingMeta
. - The
nb_of_stop
is incremented everytimestop!
orupdate_and_stop!
is called - The
optimality0
is modified once at the beginning of the algorithm (start!
) - The
start_time
is modified once at the beginning of the algorithm (start!
) if not precised before. - The different status:
fail_sub_pb
,unbounded
,unbounded_pb
,tired
,stalled
,iteration_limit
,resources
,optimal
,main_pb
,domainerror
,suboptimal
,infeasible
fail_sub_pb
,suboptimal
, andinfeasible
are modified by the algorithm.optimality_check
takes two inputs (AbstractNLPModel
,NLPAtX
)
and returns a Number
or an AbstractVector
to be compared to 0
.
optimality_check
does not necessarily fill in the State.
Examples: StoppingMeta()
, StoppingMeta(1., -1.)
General Functions
Stopping.start!
— FunctionUpdate the Stopping and return true
if we must stop.
start!(:: AbstractStopping; no_opt_check :: Bool = false, kwargs...)
Purpose is to know if there is a need to even perform an optimization algorithm or if we are at an optimal solution from the beginning. Set no_opt_check
to true
avoid checking optimality and domain errors.
The function start!
successively calls: _domain_check(stp, x)
, _optimality_check!(stp, x)
, _null_test(stp, x)
and _user_check!(stp, x, true)
.
Note: - start!
initializes stp.meta.start_time
(if not done before), stp.current_state.current_time
and stp.meta.optimality0
(if no_opt_check
is false). - Keywords argument are passed to the _optimality_check!
call. - Compatible with the StopRemoteControl
.
Stopping.update_and_start!
— Functionupdate_and_start!: update values in the State and initialize the Stopping. Returns the optimality status of the problem as a boolean.
update_and_start!(:: AbstractStopping; kwargs...)
Note:
- Kwargs are forwarded to the
update!
call. no_opt_check
skip optimality check instart!
(false
by default).
Stopping.stop!
— Functionstop!: update the Stopping and return a boolean true if we must stop.
stop!(:: AbstractStopping; kwargs...)
It serves the same purpose as start!
in an algorithm; telling us if we stop the algorithm (because we have reached optimality or we loop infinitely, etc).
The function stop!
successively calls: _domain_check
, _optimality_check
, _null_test
, _unbounded_check!
, _tired_check!
, _resources_check!
, _stalled_check!
, _iteration_check!
, _main_pb_check!
, add_to_list!
Note:
- kwargs are sent to the
_optimality_check!
call. - If
listofstates != VoidListofStates
, calladd_to_list!
.
Stopping.update_and_stop!
— Functionupdate_and_stop!: update the values in the State and return the optimality status of the problem as a boolean.
update_and_stop!(stp :: AbstractStopping; kwargs...)
Note: Kwargs are forwarded to the update!
call.
Missing docstring for Stopping.reinit!
. Check Documenter's build log for details.
Stopping.fill_in!
— Functionfill_in!: fill in the unspecified values of the AbstractState.
fill_in!(:: AbstractStopping, x :: Union{Number, AbstractVector})
Note: NotImplemented for Abstract/Generic-Stopping.
fill_in!: (NLPStopping version) a function that fill in the required values in the NLPAtX
.
fill_in!( :: NLPStopping, :: Union{AbstractVector, Nothing}; fx :: Union{AbstractVector, Nothing} = nothing, gx :: Union{AbstractVector, Nothing} = nothing, Hx :: Union{MatrixType, Nothing} = nothing, cx :: Union{AbstractVector, Nothing} = nothing, Jx :: Union{MatrixType, Nothing} = nothing, lambda :: Union{AbstractVector, Nothing} = nothing, mu :: Union{AbstractVector, Nothing} = nothing, matrix_info :: Bool = true, kwargs...)
Stopping.status
— Functionstatus: returns the status of the algorithm:
status(:: AbstractStopping; list = false)
The different statuses are:
- Optimal: reached an optimal solution.
- SubProblemFailure
- SubOptimal: reached an acceptable solution.
- Unbounded: current iterate too large in norm.
- UnboundedPb: unbouned problem.
- Stalled: stalled algorithm.
- IterationLimit: too many iterations of the algorithm.
- TimeLimit: time limit.
- EvaluationLimit: too many ressources used, i.e. too many functions evaluations.
- ResourcesOfMainProblemExhausted: in the case of a substopping, EvaluationLimit or TimeLimit for the main stopping.
- Infeasible: default return value, if nothing is done the problem is considered feasible.
- StopByUser: stopped by the user.
- DomainError: there is a NaN somewhere.
- Exception: unhandled exception
- Unknwon: if stopped for reasons unknown by Stopping.
Note:
- Set keyword argument
list
to true, to get anArray
with all the statuses. - The different statuses correspond to boolean values in the meta.
Stopping.init_max_counters
— Functioninit_max_counters: initialize the maximum number of evaluations on each of the functions present in the NLPModels.Counters, e.g.
init_max_counters(; allevals :: T = 20000, obj = allevals, grad = allevals, cons = allevals, jcon = allevals, jgrad = allevals, jac = allevals, jprod = allevals, jtprod = allevals, hess = allevals, hprod = allevals, jhprod = allevals, sum = 11 * allevals, kwargs...)
:neval_sum
is by default limited to |Counters| * allevals
.
Stopping.init_max_counters_NLS
— Functioninit_max_counters_NLS: initialize the maximum number of evaluations on each of the functions present in the NLPModels.NLSCounters
, e.g.
init_max_counters_NLS(; allevals = 20000, residual = allevals, jac_residual = allevals, jprod_residual = allevals, jtprod_residual = allevals, hess_residual = allevals, jhess_residual = allevals, hprod_residual = allevals, kwargs...)
Stopping.init_max_counters_linear_operators
— Functioninit_max_counters_linear_operators: counters for LinearOperator
init_max_counters_linear_operators(; allevals :: T = 20000, nprod = allevals, ntprod = allevals, nctprod = allevals, sum = 11 * allevals)
Non-linear admissibility functions
Stopping.KKT
— FunctionKKT: verifies the KKT conditions
KKT( :: AbstractNLPModel, :: NLPAtX; pnorm :: Float64 = Inf, kwargs...)
Note: state.gx
is mandatory + if bounds state.mu
+ if constraints state.cx
, state.Jx
, state.lambda
.
See also unconstrained_check
, unconstrained2nd_check
, optim_check_bounded
Stopping.unconstrained_check
— Functionunconstrained_check: return the infinite norm of the gradient of the objective function
unconstrained_check( :: AbstractNLPModel, :: NLPAtX; pnorm :: Float64 = Inf, kwargs...)
Require state.gx
(filled if not provided)
See also unconstrained2nd_check
, optim_check_bounded
, KKT
Stopping.unconstrained2nd_check
— Functionunconstrained2nd_check: check the norm of the gradient and the smallest eigenvalue of the hessian.
unconstrained2nd_check( :: AbstractNLPModel, :: NLPAtX; pnorm :: Float64 = Inf, kwargs...)
Require are state.gx
, state.Hx
(filled if not provided).
See also unconstrained_check
, optim_check_bounded
, KKT
Stopping.optim_check_bounded
— Functionoptim_check_bounded: gradient of the objective function projected
optim_check_bounded( :: AbstractNLPModel, :: NLPAtX; pnorm :: Float64 = Inf, kwargs...)
Require state.gx
(filled if not provided).
See also unconstrained_check
, unconstrained2nd_check
, KKT
Linear algebra admissibility functions
Stopping.linear_system_check
— Functionlinear_system_check: return ||Ax-b||_p
linear_system_check(:: Union{LinearSystem, LLSModel}, :: AbstractState; pnorm :: Float64 = Inf, kwargs...)
Note:
- Returns the p-norm of state.res
- state.res is filled in if nothing.
Stopping.normal_equation_check
— Functionnormal_equation_check: return ||A'Ax-A'b||_p
normal_equation_check(:: Union{LinearSystem, LLSModel}, :: AbstractState; pnorm :: Float64 = Inf, kwargs...)
Note: pb must have A and b entries
Line search admissibility functions
Stopping.armijo
— Functionarmijo: check if a step size is admissible according to the Armijo criterion.
Armijo criterion: f(x + θd) - f(x) - τ₀ θ ∇f(x+θd)d < 0
armijo(h :: Any, h_at_t :: OneDAtX; τ₀ :: Float64 = 0.01, kwargs...)
Note: fx, f₀ and g₀ are required in the OneDAtX
See also wolfe
, armijo_wolfe
, shamanskii_stop
, goldstein
Stopping.wolfe
— Functionwolfe: check if a step size is admissible according to the Wolfe criterion.
Strong Wolfe criterion: |∇f(x+θd)| < τ₁||∇f(x)||.
wolfe(h :: Any, h_at_t :: OneDAtX; τ₁ :: Float64 = 0.99, kwargs...)
Note: gx and g₀ are required in the OneDAtX
See also armijo
, armijo_wolfe
, shamanskii_stop
, goldstein
Stopping.armijo_wolfe
— Functionarmijo_wolfe: check if a step size is admissible according to the Armijo and Wolfe criteria.
armijo_wolfe(h :: Any, h_at_t :: OneDAtX; τ₀ :: Float64 = 0.01, τ₁ :: Float64 = 0.99, kwargs...)
Note: fx, f₀, gx and g₀ are required in the OneDAtX
See also armijo
, wolfe
, shamanskii_stop
, goldstein
Stopping.shamanskii_stop
— Functionshamanskii_stop: check if a step size is admissible according to the "Shamanskii" criteria. This criteria was proposed in: Lampariello, F., & Sciandrone, M. (2001). Global convergence technique for the Newton method with periodic Hessian evaluation. Journal of optimization theory and applications, 111(2), 341-358.
shamanskii_stop(h :: Any, h_at_t :: OneDAtX; γ :: Float64 = 1.0e-09, kwargs...)
Note:
- h.d accessible (specific LineModel)
- fx, f₀ are required in the OneDAtX
See also armijo
, wolfe
, armijo_wolfe
, goldstein
Stopping.goldstein
— Functiongoldstein: check if a step size is admissible according to the Goldstein criteria.
goldstein(h :: Any, h_at_t :: OneDAtX; τ₀ :: Float64 = 0.0001, τ₁ :: Float64 = 0.9999, kwargs...)
Note: fx, f₀ and g₀ are required in the OneDAtX
See also armijo
, wolfe
, armijo_wolfe
, shamanskii_stop