You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/tutorials/backends/optim.md
+10-10Lines changed: 10 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -1,23 +1,23 @@
1
1
# Using Optim.jl
2
2
3
-
[`SemOptimizerOptim`](@ref) implements the connection to `Optim.jl`.
4
-
It takes two arguments, `algorithm` and `options`.
5
-
The defaults are LBFGS as the optimization algorithm and the standard options from `Optim.jl`.
6
-
We can load the `Optim` and `LineSearches` packages to choose something different:
3
+
[Optim.jl](https://github.com/JuliaNLSolvers/Optim.jl) is the default optimization engine of *SEM.jl*,
4
+
see [`SemOptimizerOptim`](@ref) for a full list of its parameters.
5
+
It defaults to the LBFGS optimization, but we can load the `Optim` and `LineSearches` packages
6
+
and specify BFGS (!not L-BFGS) with a back-tracking linesearch and Hager-Zhang initial step length guess:
7
7
8
8
```julia
9
9
using Optim, LineSearches
10
10
11
-
my_optimizer =SemOptimizerOptim(
11
+
my_optimizer =SemOptimizer(
12
12
algorithm =BFGS(
13
-
linesearch =BackTracking(order=3),
13
+
linesearch =BackTracking(order=3),
14
14
alphaguess =InitialHagerZhang()
15
-
),
16
-
options = Optim.Options(show_trace =true)
17
-
)
15
+
),
16
+
options = Optim.Options(show_trace =true)
17
+
)
18
18
```
19
19
20
-
This optimizer will use BFGS (!not L-BFGS) with a back tracking linesearch and a certain initial step length guess. Also, the trace of the optimization will be printed to the console.
20
+
Note that we used `options` to print the optimization progress to the console.
21
21
22
22
To see how to use the optimizer to actually fit a model now, check out the [Model fitting](@ref) section.
0 commit comments