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: .github/workflows/Documentation.yml
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -16,15 +16,15 @@ jobs:
16
16
with:
17
17
version: '1'
18
18
- name: Install dependencies
19
-
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(vcat(PackageSpec(path = pwd()), [PackageSpec(path = joinpath("lib", dir)) for dir in readdir("lib") if dir !== "OptimizationQuadDIRECT"])); Pkg.instantiate()'
19
+
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(vcat(PackageSpec(path = pwd()), [PackageSpec(path = joinpath("lib", dir)) for dir in readdir("lib") if (dir !== "OptimizationQuadDIRECT" && dir !== "OptimizationMultistartOptimization")])); Pkg.instantiate()'
20
20
- name: Build and deploy
21
21
env:
22
22
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token
23
23
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key
24
24
run: julia --project=docs/ --code-coverage=user docs/make.jl
1. The main change in this breaking release has been the way mini-batching is handled. The data argument in the solve call and the implicit iteration of that in the callback has been removed,
4
+
the stochastic solvers (Optimisers.jl and Sophia) now handle it explicitly. You would now pass in a DataLoader to OptimizationProblem as the second argument to the objective etc (p) if you
5
+
want to do minibatching, else for full batch just pass in the full data.
6
+
7
+
2. The support for extra returns from objective function has been removed. Now the objective should only return a scalar loss value, hence callback doesn't take extra arguments other than the state and loss value.
Tada! That's how you do it. Now let's dive in a little more into what each part means and how to customize it all to your needs.
37
+
38
+
## Understanding the Solution Object
39
+
40
+
The solution object is a `SciMLBase.AbstractNoTimeSolution`, and thus it follows the
41
+
[SciMLBase Solution Interface for non-timeseries objects](https://docs.sciml.ai/SciMLBase/stable/interfaces/Solutions/) and is documented at the [solution type page](@ref solution).
42
+
However, for simplicity let's show a bit of it in action.
43
+
44
+
An optimization solution has an array interface so that it acts like the array that it solves for. This array syntax is shorthand for simply grabbing the solution `u`. For example:
45
+
46
+
```@example intro
47
+
sol[1] == sol.u[1]
48
+
```
49
+
50
+
```@example intro
51
+
Array(sol) == sol.u
52
+
```
53
+
54
+
`sol.objective` returns the final cost of the optimization. We can validate this by plugging it into our function:
55
+
56
+
```@example intro
57
+
rosenbrock(sol.u, p)
58
+
```
59
+
60
+
```@example intro
61
+
sol.objective
62
+
```
63
+
64
+
The `sol.retcode` gives us more information about the solution process.
65
+
66
+
```@example intro
67
+
sol.retcode
68
+
```
69
+
70
+
Here it says `ReturnCode.Success` which means that the solutuion successfully solved. We can learn more about the different return codes at
71
+
[the ReturnCode part of the SciMLBase documentation](https://docs.sciml.ai/SciMLBase/stable/interfaces/Solutions/#retcodes).
72
+
73
+
If we are interested about some of the statistics of the solving process, for example to help choose a better solver, we can investigate the `sol.stats`
74
+
75
+
```@example intro
76
+
sol.stats
77
+
```
78
+
79
+
That's just a bit of what's in there, check out the other pages for more information but now let's move onto customization.
80
+
20
81
## Import a different solver package and solve the problem
21
82
22
83
OptimizationOptimJL is a wrapper for [Optim.jl](https://github.com/JuliaNLSolvers/Optim.jl) and OptimizationBBO is a wrapper for [BlackBoxOptim.jl](https://github.com/robertfeldt/BlackBoxOptim.jl).
0 commit comments