Skip to content

Commit

Permalink
try forward
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Nov 3, 2024
1 parent b6b324e commit c62306f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/src/examples/sde/SDE_control.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,17 +190,17 @@ function loss(p_nn; alg = EM(), sensealg = BacksolveAdjoint(autojacvec = Reverse
W1 = cumsum([zero(myparameters.dt); W[1:(end - 1)]], dims = 1)
NG = CreateGrid(myparameters.ts, W1)
remake(prob,
p = pars,
u0 = u0tmp,
callback = callback,
noise = NG)
end
_prob = remake(prob, p = pars)
ensembleprob = EnsembleProblem(prob,
ensembleprob = EnsembleProblem(_prob,
prob_func = prob_func,
safetycopy = true)
_sol = solve(ensembleprob, alg, EnsembleThreads(),
_sol = solve(ensembleprob, alg, EnsembleSerial(),
sensealg = sensealg,
saveat = myparameters.tinterval,
dt = myparameters.dt,
Expand Down Expand Up @@ -292,7 +292,7 @@ visualization_callback((; u = p_nn), l; doplot = true)
# optimize the parameters for a few epochs with Adam on time span
# Setup and run the optimization
adtype = Optimization.AutoZygote()
adtype = Optimization.AutoForwardDiff()
optf = Optimization.OptimizationFunction((x, p) -> loss(x), adtype)
optprob = Optimization.OptimizationProblem(optf, p_nn)
Expand Down Expand Up @@ -654,7 +654,7 @@ is computed under the hood in the SciMLSensitivity package.
```@example sdecontrol
# optimize the parameters for a few epochs with Adam on time span
# Setup and run the optimization
adtype = Optimization.AutoZygote()
adtype = Optimization.AutoForwardDiff()
optf = Optimization.OptimizationFunction((x, p) -> loss(x), adtype)
optprob = Optimization.OptimizationProblem(optf, p_nn)
Expand Down

0 comments on commit c62306f

Please sign in to comment.