What does dev do exactly in this case?
After you dev
a package in an enrivonment, you’d be using
the copy of the package in ~/.julia/dev/
instead of the original copy in ~/.julia/packages/
. That way, any modification you make to the copy in ~/.julia/dev
will not change the behavior of the package used in other environments. In short, you won’t be using prototypes in your production environment. (See more information by entering pkg> ?dev
.)
Are there any other parts inside Optim
which I need to modify? Or just creating a new file and using include
is enough to have the same functionality for my optimizer as for the already implemented BFGS()
(e.g. will solve recognise it, will it be fast etc).
You will need to export yournewmethod
if you don’t want to be explicitly using
it.
You probably will have to implement something in fminbox.jl
since that’s the other place where the name occurs in src/
(as a non-comment).
➜ Optim git:(master) grep -ir " bfgs" src/
src//multivariate/optimize/optimize.jl: break # it returns true if it's forced by something in update! to stop (eg dx_dg == 0.0 in BFGS, or linesearch errors)
src//multivariate/solvers/first_order/bfgs.jl:struct BFGS{IL, L, H, T, TM} <: FirstOrderOptimizer
src//multivariate/solvers/first_order/bfgs.jl:# BFGS
src//multivariate/solvers/first_order/bfgs.jl:function BFGS(; alphaguess = LineSearches.InitialStatic(), # TODO: benchmark defaults
src//multivariate/solvers/first_order/bfgs.jl: BFGS(_alphaguess(alphaguess), linesearch, initial_invH, initial_stepnorm, manifold)
src//multivariate/solvers/first_order/bfgs.jl:mutable struct BFGSState{Tx, Tm, T,G} <: AbstractOptimizerState
src//multivariate/solvers/first_order/bfgs.jl: BFGSState(initial_x, # Maintain current state in state.x
src//multivariate/solvers/first_order/l_bfgs.jl:The `LBFGS` method implements the limited-memory BFGS algorithm as described in
src//multivariate/solvers/constrained/ipnewton/interior.jl: update_state!(d, constraints, state, method, options) && break # it returns true if it's forced by something in update! to stop (eg dx_dg == 0.0 in BFGS or linesearch errors)
src//multivariate/solvers/constrained/fminbox.jl:barrier_method(m::Union{NelderMead, SimulatedAnnealing, ParticleSwarm, BFGS, AbstractNGMRES},
src//Optim.jl: BFGS,
src//utilities/assess_convergence.jl:# AcceleratedGradientDescentState, BFGSState, ConjugateGradientState,
As for the performance, it will depend on how you implement the method and how well you optimize it (in terms of performance). I can’t guarantee anything.