Skip to content

Commit

Permalink
docs: use BFGS with back tracking for low level system tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
sathvikbhagavan committed Mar 13, 2024
1 parent b05a35d commit 66db48f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions docs/src/tutorials/low_level.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ u(t, -1) = u(t, 1) = 0 \, ,
with Physics-Informed Neural Networks. Here is an example of using the low-level API:

```@example low_level
using NeuralPDE, Lux, ModelingToolkit, Optimization, OptimizationOptimJL
using NeuralPDE, Lux, ModelingToolkit, Optimization, OptimizationOptimJL, LineSearches
using ModelingToolkit: Interval, infimum, supremum
@parameters t, x
Expand All @@ -37,7 +37,7 @@ domains = [t ∈ Interval(0.0, 1.0),
# Neural network
chain = Lux.Chain(Dense(2, 16, Lux.σ), Dense(16, 16, Lux.σ), Dense(16, 1))
strategy = NeuralPDE.QuadratureTraining()
strategy = NeuralPDE.QuadratureTraining(; abstol = 1e-6, reltol = 1e-6, batch = 200)
indvars = [t, x]
depvars = [u(t, x)]
Expand Down Expand Up @@ -67,8 +67,7 @@ end
f_ = OptimizationFunction(loss_function, Optimization.AutoZygote())
prob = Optimization.OptimizationProblem(f_, sym_prob.flat_init_params)
res = Optimization.solve(prob, OptimizationOptimJL.BFGS(); callback = callback,
maxiters = 2000)
res = Optimization.solve(prob, BFGS(linesearch = BackTracking()); callback = callback, maxiters = 3000)
```

And some analysis:
Expand Down
2 changes: 1 addition & 1 deletion docs/src/tutorials/pdesystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ end
# Optimizer
opt = OptimizationOptimJL.LBFGS(linesearch = BackTracking())
res = solve(prob, opt, callback = callback, maxiters = 2000)
res = solve(prob, opt, callback = callback, maxiters = 1000)
phi = discretization.phi
dx = 0.05
Expand Down

0 comments on commit 66db48f

Please sign in to comment.