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
# Comparing subsolvers for nonlinear least squares in JSOSolvers
7
+
# Comparing subsolvers for nonlinear least squares JSOSolvers solvers
8
8
9
9
This tutorial showcases some advanced features of solvers in JSOSolvers.
10
10
11
-
**Note**: This tutorial is compatible with JSOSolvers 0.11. The subsolver is selected using the `subsolver_type` parameter with Krylov solver types (e.g., `CglsSolver`, `LsmrSolver`).
12
-
13
11
```julia
14
12
using JSOSolvers
15
13
```
16
14
17
-
We benchmark different subsolvers used in the solver TRUNK for unconstrained nonlinear least squares problems.
15
+
We benchmark different subsolvers used in the solvers TRUNK for unconstrained nonlinear least squares problems.
18
16
The first step is to select a set of problems that are nonlinear least squares.
19
17
20
18
```julia
@@ -40,14 +38,13 @@ For this task, several solvers are available.
40
38
JSOSolvers.trunkls_allowed_subsolvers
41
39
```
42
40
43
-
This benchmark could also be followed for the solver TRON where the following subsolvers are available.
41
+
This benchmark could also be followed for the solver TRON where the following subsolver are available.
44
42
45
43
```julia
46
44
JSOSolvers.tronls_allowed_subsolvers
47
45
```
48
46
49
47
These linear least squares solvers are implemented in the package [Krylov.jl](https://github.com/JuliaSmoothOptimizers/Krylov.jl).
50
-
For detailed descriptions of each subsolver's algorithm and when to use it, see the [Krylov.jl documentation](https://jso.dev/Krylov.jl/stable/).
51
48
52
49
```julia
53
50
using Krylov
@@ -56,20 +53,6 @@ using Krylov
56
53
We define a dictionary of the different solvers that will be benchmarked.
57
54
We consider here four variants of TRUNK using the different subsolvers.
58
55
59
-
For example, to call TRUNK with an explicit subsolver:
60
-
61
-
```julia
62
-
stats = trunk(nls, subsolver_type = CglsSolver)
63
-
```
64
-
65
-
The same subsolver selection pattern applies to TRON's least-squares specialization:
The CRLS and CGLS variants are the ones solving more problems, and even though the difference is rather small the CGLS variant is consistently faster which seems to indicate that it is the most appropriate subsolver for TRUNK.
111
-
The size of the problems was rather small here, so this should be confirmed on larger instances.
94
+
The size of the problems were rather small here, so this should be confirmed on larger instance.
112
95
Moreover, the results may vary depending on the origin of the test problems.
0 commit comments