Skip to content

Commit

Permalink
fixup! docs: update tutorials
Browse files Browse the repository at this point in the history
  • Loading branch information
sathvikbhagavan committed Mar 7, 2024
1 parent 9ba9932 commit 62a4b49
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions docs/src/tutorials/constraints.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ with Physics-Informed Neural Networks.
```@example fokkerplank
using NeuralPDE, Lux, ModelingToolkit, Optimization, OptimizationOptimJL
using Integrals, Cubature
import ModelingToolkit: Interval, infimum, supremum
using ModelingToolkit: Interval, infimum, supremum
# the example is taken from this article https://arxiv.org/abs/1910.10503
@parameters x
@variables p(..)
Expand Down Expand Up @@ -63,7 +63,7 @@ function norm_loss_function(phi, θ, p)
end
discretization = PhysicsInformedNN(chain,
GridTraining(0.01),
QuadratureTraining(),
additional_loss = norm_loss_function)
@named pdesystem = PDESystem(eq, bcs, domains, [x], [p(x)])
Expand All @@ -84,9 +84,7 @@ cb_ = function (p, l)
return false
end
res = Optimization.solve(prob, LBFGS(), callback = cb_, maxiters = 400)
prob = remake(prob, u0 = res.u)
res = Optimization.solve(prob, BFGS(), callback = cb_, maxiters = 500)
res = Optimization.solve(prob, BFGS(), callback = cb_, maxiters = 2000)
```

And some analysis:
Expand Down
2 changes: 1 addition & 1 deletion docs/src/tutorials/derivative_neural_network.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ end
res = Optimization.solve(prob, OptimizationOptimisers.Adam(0.01); callback = callback, maxiters = 2000)
prob = remake(prob, u0 = res.u)
res = Optimization.solve(prob, LBFGS(linesearch = BackTracking()); callback = callback, maxiters = 1000)
res = Optimization.solve(prob, LBFGS(linesearch = BackTracking()); callback = callback, maxiters = 200)
phi = discretization.phi
```
Expand Down

0 comments on commit 62a4b49

Please sign in to comment.