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/api.md
+38
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,44 @@ To construct a continuous DEQ, any ODE solver compatible with `DifferentialEquat
9
9
can be passed as the solver. To construct a discrete DEQ, any root finding algorithm
10
10
compatible with `NonlinearSolve.jl` API can be passed as the solver.
11
11
12
+
## Choosing a Solver
13
+
14
+
### Root Finding Algorithms
15
+
16
+
Using Root Finding Algorithms give fast convergence when possible, but these methods also
17
+
tend to be unstable. If you must use a root finding algorithm, we recommend using:
18
+
19
+
1.`NewtonRaphson` or `TrustRegion` for small models
20
+
2.`LimitedMemoryBroyden` for large Deep Learning applications (with well-conditioned
21
+
Jacobians)
22
+
3.`NewtonRaphson(; linsolve = KrylovJL_GMRES())` for cases when Broyden methods fail
23
+
24
+
Note that Krylov Methods rely on efficient VJPs which are not available for all Lux models.
25
+
If you think this is causing a performance regression, please open an issue in
26
+
[Lux.jl](https://github.com/LuxDL/Lux.jl).
27
+
28
+
### ODE Solvers
29
+
30
+
Using ODE Solvers give slower convergence, but are more stable. We generally recommend these
31
+
methods over root finding algorithms. If you use implicit ODE solvers, remember to use
32
+
Krylov linear solvers, see OrdinaryDiffEq.jl documentation for these. For most cases, we
33
+
recommend:
34
+
35
+
1.`VCAB3()` for high tolerance problems
36
+
2.`Tsit5()` for high tolerance problems where `VCAB3()` fails
37
+
3. In all other cases, follow the recommendation given in [OrdinaryDiffEq.jl](https://docs.sciml.ai/DiffEqDocs/stable/solvers/ode_solve/#ode_solve) documentation
38
+
39
+
### Sensitivity Analysis
40
+
41
+
1. For `MultiScaleNeuralODE`, we default to `GaussAdjoint(; autojacvec = ZygoteVJP())`. A
42
+
faster alternative would be `BacksolveAdjoint(; autojacvec = ZygoteVJP())` but there are
43
+
stability concerns for using that. Follow the recommendation given in [SciMLSensitivity.jl](https://docs.sciml.ai/SciMLSensitivity/stable/manual/differential_equation_sensitivities/#Choosing-a-Sensitivity-Algorithm) documentation.
0 commit comments