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
docs: switch second_order_adjoints Phase 1 and brusselator to Mooncake
- second_order_adjoints.md: Phase 1 (Adam) now uses AutoMooncake, Phase
2 (NewtonTrustRegion) stays on AutoZygote (Hessian via
SecondOrder(ForwardDiff, Zygote)) pending forward-over-Mooncake support
(chalk-lab/Mooncake.jl#1142). Split into two OptimizationFunctions to
avoid applying the wrong backend to Phase 2.
- brusselator.md: switch AutoZygote → AutoMooncake with friendly_tangents.
Tested locally with N_GRID=8 and shortened tspan — Mooncake gradient
chain works end-to-end (loss decreasing from 0.131 to 0.059 in 3 Adam
steps).
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Copy file name to clipboardExpand all lines: docs/src/examples/pde/brusselator.md
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -156,7 +156,7 @@ First, we have to define and configure the neural network that has to be used fo
156
156
157
157
```@example bruss
158
158
import Lux, Random, Optimization as OPT, OptimizationOptimJL as OOJ,
159
-
SciMLSensitivity as SMS, Zygote
159
+
SciMLSensitivity as SMS, Mooncake
160
160
161
161
model = Lux.Chain(Lux.Dense(2 => 16, tanh), Lux.Dense(16 => 1))
162
162
rng = Random.default_rng()
@@ -223,12 +223,13 @@ function loss_fn(ps, _)
223
223
end
224
224
```
225
225
226
-
Once the loss function is defined, we use the ADAM optimizer to train the neural network. The optimization problem is defined using SciML's `Optimization.jl` tools, and gradients are computed via automatic differentiation using `AutoZygote()` from `SciMLSensitivity`:
226
+
Once the loss function is defined, we use the ADAM optimizer to train the neural network. The optimization problem is defined using SciML's `Optimization.jl` tools, and gradients are computed via automatic differentiation using Mooncake through the `SciMLSensitivity` adjoint chain:
0 commit comments