Skip to content

Commit a41ee42

Browse files
authored
docs for new options in Optim solvers (#134)
* more flexible optim options * fix types * fix * add some docs
1 parent b050cb2 commit a41ee42

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

src/fit/solvers.jl

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,17 @@ $SIGNATURES
4141
4242
Newton solver. This is a full Hessian solver and should be avoided for
4343
"large scale" cases.
44+
45+
`optim_options` are the [general Optim Options](https://julianlsolvers.github.io/Optim.jl/stable/#user/config/).
46+
`newton_options` are the [options of Newton's method](https://julianlsolvers.github.io/Optim.jl/stable/#algo/newton/)
47+
48+
## Example
49+
```julia
50+
using MLJLinearModels, Optim
51+
52+
solver = MLJLinearModels.Newton(optim_options = Optim.Options(time_limit = 20),
53+
newton_options = (linesearch = Optim.LineSearches.HagerZhang()),))
54+
```
4455
"""
4556
@with_kw struct Newton{O,S} <: Solver
4657
optim_options::O = Optim.Options()
@@ -54,6 +65,18 @@ Newton CG solver. This is the same as the Newton solver except that instead
5465
of solving systems of the form `H\\b` where `H` is the full Hessian, it uses
5566
a matrix-free conjugate gradient approach to solving that system. This should
5667
generally be preferred for larger scale cases.
68+
69+
`optim_options` are the [general Optim Options](https://julianlsolvers.github.io/Optim.jl/stable/#user/config/).
70+
`newtoncg_options` are the [options of Krylov Trust Region method](https://github.com/JuliaNLSolvers/Optim.jl/blob/master/src/multivariate/solvers/second_order/krylov_trust_region.jl)
71+
72+
## Example
73+
```julia
74+
using MLJLinearModels, Optim
75+
76+
solver = MLJLinearModels.Newton(optim_options = Optim.Options(time_limit = 20),
77+
newtoncg_options = (eta = 0.2,))
78+
```
79+
5780
"""
5881
@with_kw struct NewtonCG{O,S} <: Solver
5982
optim_options::O = Optim.Options()
@@ -64,6 +87,17 @@ end
6487
$SIGNATURES
6588
6689
LBFGS quasi-Newton solver. See [the wikipedia entry](https://en.wikipedia.org/wiki/Limited-memory_BFGS).
90+
91+
`optim_options` are the [general Optim Options](https://julianlsolvers.github.io/Optim.jl/stable/#user/config/).
92+
`lbfgs_options` are the [options of LBFGS method](https://julianlsolvers.github.io/Optim.jl/stable/#algo/lbfgs/)
93+
94+
## Example
95+
```julia
96+
using MLJLinearModels, Optim
97+
98+
solver = MLJLinearModels.Newton(optim_options = Optim.Options(time_limit = 20),
99+
lbfgs_options = (linesearch = Optim.LineSearches.HagerZhang()),))
100+
```
67101
"""
68102
@with_kw struct LBFGS{O,S} <: Solver
69103
optim_options::O = Optim.Options()

0 commit comments

Comments
 (0)