Skip to content

Commit ae86bac

Browse files
decrease tolerance in solvers
1 parent fe27fcb commit ae86bac

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/src/examples/basic.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,20 +59,20 @@ The following tries to give a quick overview of what choices one can make.
5959

6060
Suppose for example that we don't want to use a quasi-Newton approach and that we don't have access to the Hessian of f, or that we don't want to incur the cost of computing it.
6161
In this case, the most appropriate solver would be R2.
62-
For this example, we also choose a relatively small tolerance by specifying the keyword arguments `atol` and `rtol` across all solvers.
62+
For this example, we also choose a tolerance by specifying the keyword arguments `atol` and `rtol` across all solvers.
6363

6464
```@example basic
6565
using RegularizedOptimization
6666
67-
out = R2(regularized_pb, verbose = 10, atol = 1e-3, rtol = 1e-3)
67+
out = R2(regularized_pb, verbose = 100, atol = 1e-6, rtol = 1e-6)
6868
println("R2 converged after $(out.iter) iterations to the solution x = $(out.solution)")
6969
```
7070

7171
Now, we can actually use second information on f.
7272
To do so, we are going to use TR, a trust-region solver that can exploit second order information.
7373
```@example basic
7474
75-
out = TR(regularized_pb, verbose = 10, atol = 1e-3, rtol = 1e-3)
75+
out = TR(regularized_pb, verbose = 100, atol = 1e-6, rtol = 1e-6)
7676
println("TR converged after $(out.iter) iterations to the solution x = $(out.solution)")
7777
```
7878

@@ -87,7 +87,7 @@ f_model_lsr1 = LSR1Model(f_model)
8787
regularized_pb_lsr1 = RegularizedNLPModel(f_model_lsr1, h)
8888
8989
# Solve with R2N
90-
out = R2N(regularized_pb_lsr1, verbose = 10, atol = 1e-3, rtol = 1e-3)
90+
out = R2N(regularized_pb_lsr1, verbose = 100, atol = 1e-6, rtol = 1e-6)
9191
println("R2N converged after $(out.iter) iterations to the solution x = $(out.solution)")
9292
```
9393

@@ -98,6 +98,6 @@ f_model_sg = SpectralGradientModel(f_model)
9898
regularized_pb_sg = RegularizedNLPModel(f_model_sg, h)
9999
100100
# Solve with R2DH
101-
out = R2DH(regularized_pb_sg, verbose = 10, atol = 1e-3, rtol = 1e-3)
101+
out = R2DH(regularized_pb_sg, verbose = 100, atol = 1e-6, rtol = 1e-6)
102102
println("R2DH converged after $(out.iter) iterations to the solution x = $(out.solution)")
103103
```

0 commit comments

Comments
 (0)