Skip to content

Commit

Permalink
Merge branch 'master' into sb/mtkv9
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas authored Mar 28, 2024
2 parents 0556f6e + 0cb2e06 commit 945c75c
Show file tree
Hide file tree
Showing 34 changed files with 445 additions and 412 deletions.
2 changes: 1 addition & 1 deletion .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ steps:
queue: "juliagpu"
cuda: "*"
if: build.message !~ /\[skip docs\]/ && !build.pull_request.draft
timeout_in_minutes: 1000
timeout_in_minutes: 1440

env:
SECRET_DOCUMENTER_KEY: "yBJHrf5zUPu3VFotb0W4TRdauMTGgNUei3ax0xrVTmcrrP3EX8zSGaj9MNZji9H6JqyNEhCqZMGcHhxR5XK0f97YjhAp5rDNpwV6FbIXY8FXgFyIOLAenYUklta1W6fNM7KTz3Dq3UnKBAprKhQBwUw3SldTuvtm+IhiVT2rFmADqxMSQcv+5LivYEgAFrrd6LX+PHhonj38VN46z5Bi3TOIGAnByVlZssX7cOwaRg/8TloLPsWAUlQiPr89Vdlow9k6SQV8W9mf00/Rq4LFd1Eq1EYTCSmReVawMxVpXh1mj7MSabf9ppVWYOmjP5Rzatk8YFWlJf80HVvzY7tXRQ==;U2FsdGVkX1/UmKrEQkyqoZY6GckLGmpV5SsPa2byZhZbomiJKIrLntTIHK9GclgfCJ1MDCKhuo3hMVxq+NKVm0QmnMZk0Hlzszx8Up5pbcuSb2BA0Wm7IJzZ5/2uXfdBOXIejwk+GUabJtSpiDlYJUW/8bOWYZUwl9rmrOM44tPesEcs5yMZPShIowZnJqrvQUcWXZ/+aZjftX+Pe7nP0KddzYRYzhIJVzYmU394V9MWqZDqaNU19TJqnL8dNQxFLfyDibXuCqSD9QjV2I/iCfwr1xI81h11vmaatpZCDUUGYyxLRh1w5BuT1hHvLqktoAGliBD2lSOEB5KbwJu0nQCbEXPsM6CpMb4JygFloViQJ1L0kb91JEZIrnP6ruM1rrgrRu8Ufb+hob+BsC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9jsGAEXBS6EX754sT3hYLB9OK6INME0rAbHUmq9tvCknIAiH3LIwuJJHHBLEFVeYveTk/00iBHjvn4Yb9MYEPaiTgMcQwRz8khf1aWj/Vz16c2aOjdiZOBEDpxH5h5tJLAMmc8bHfVAhWqdC6hDaulAgHEuo5gcKbkIbWEX/jvuOJq0fO9EYz6eDwwPy6hGGB5pzasJIKUDvXRCh40f5Iy8DOcLJRh+KCxjD9zDqhQQZ8WC+9l1/brckKPw59n0F3Sh3c+nHfyYBBlmsONTmjUZTgRwqg92z+2YQWyUf7g5jmNtBEjLyXtNvn9HkZGXd9YVp7Ps10GklGQiKYZmWUl73KGtsfsRF+/SQ4kRumd4YnlC7b04w6tFRk3HMog+38OVZDwMj40unK4XJWYABJX0t2XySGlXrL8ZNW8xR/iCVsW6+4glxFvTeH5ujPUjQKFb/0bvbZeExeYnRECdDz6u3z/gQYZiUMA8NUNKJuQTzWV9nXyubOWEG9NuJZ4X7oaGE/DtWO3j57r8bcE9KdtV+DpGvKyS+lBrdxL5vlOJ3rX+PqWeIOkxKc85lKT/us8H054bVubQebl0Tc+rvyqZVM7MToHgDj9VwlEbfV6o02Em/J5JUh0GMCoJw6CX5rfHgAIPlhlh/wXRVj8FQcUiTSzDb8lpwXxGO9rNWNfgE9ZRduiXT5LnUYhf6BC5eomyvZ6DcqDABJyWIV7kejbT0TlspicebTzP/kMyTPrGM9TchZjMdv6bPp8jRf4lUGWBjD4i1Diris5aM="
1 change: 0 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ jobs:
- AdaptiveLoss
- Logging
- Forward
- NeuralAdapter
- DGM
version:
- "1"
Expand Down
60 changes: 60 additions & 0 deletions .github/workflows/Downgrade.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Downgrade
on:
pull_request:
branches:
- master
paths-ignore:
- 'docs/**'
push:
branches:
- master
paths-ignore:
- 'docs/**'
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
group:
- QA
- ODEBPINN
- PDEBPINN
- NNPDE1
- NNPDE2
- AdaptiveLoss
- Logging
- Forward
- DGM
version:
- "1"
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
- uses: actions/cache@v4
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- uses: julia-actions/julia-downgrade-compat@v1
with:
skip: LinearAlgebra, Pkg, Random, Test
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
env:
GROUP: ${{ matrix.group }}
- uses: julia-actions/julia-processcoverage@v1
with:
directories: src,lib/NeuralPDELogging/src
- uses: codecov/codecov-action@v4
with:
files: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
58 changes: 29 additions & 29 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "NeuralPDE"
uuid = "315f7962-48a3-4962-8226-d0f33b1235f0"
authors = ["Chris Rackauckas <[email protected]>"]
version = "5.13.0"
version = "5.14.0"

[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Expand Down Expand Up @@ -40,63 +40,63 @@ Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"

[compat]
Adapt = "4"
AdvancedHMC = "0.6"
AdvancedHMC = "0.6.1"
Aqua = "0.8"
ArrayInterface = "7"
CUDA = "5.1"
ChainRulesCore = "1"
ComponentArrays = "0.15"
ArrayInterface = "7.7"
CUDA = "5.2"
ChainRulesCore = "1.21"
ComponentArrays = "0.15.8"
Cubature = "1.5"
DiffEqBase = "6"
DiffEqNoiseProcess = "5.1"
Distributions = "0.25"
DiffEqBase = "6.144"
DiffEqNoiseProcess = "5.20"
Distributions = "0.25.107"
DocStringExtensions = "0.9"
DomainSets = "0.6, 0.7"
Flux = "0.14"
ForwardDiff = "0.10"
Functors = "0.4"
Flux = "0.14.11"
ForwardDiff = "0.10.36"
Functors = "0.4.4"
Integrals = "4"
LineSearches = "7.2"
LinearAlgebra = "1"
LogDensityProblems = "2"
Lux = "0.5"
LuxCUDA = "0.3"
Lux = "0.5.22"
LuxCUDA = "0.3.2"
MCMCChains = "6"
MethodOfLines = "0.11"
ModelingToolkit = "9"
MonteCarloMeasurements = "1"
MonteCarloMeasurements = "1.1"
Optim = "1.7.8"
Optimization = "3"
OptimizationOptimJL = "0.2"
OptimizationOptimisers = "0.2"
OrdinaryDiffEq = "6"
Optimization = "3.22"
OptimizationOptimJL = "0.2.1"
OptimizationOptimisers = "0.2.1"
OrdinaryDiffEq = "6.70"
Pkg = "1"
QuasiMonteCarlo = "0.3.2"
Random = "1"
Reexport = "1.0"
RuntimeGeneratedFunctions = "0.5"
Reexport = "1.2"
RuntimeGeneratedFunctions = "0.5.11"
SafeTestsets = "0.1"
SciMLBase = "2"
Statistics = "1"
SymbolicUtils = "1"
Symbolics = "5"
SciMLBase = "2.24"
Statistics = "1.10"
SymbolicUtils = "1.4"
Symbolics = "5.17"
Test = "1"
UnPack = "1"
Zygote = "0.6"
MethodOfLines = "0.11"
julia = "1.6"
Zygote = "0.6.69"
julia = "1.10"

[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c"
LineSearches = "d3d80556-e9d4-5f37-9878-2ab0fcc64255"
LuxCUDA = "d0bbae9a-e099-4d5b-a835-1c6931763bda"
MethodOfLines = "94925ecb-adb7-4558-8ed8-f975c56a0bf4"
OptimizationOptimJL = "36348300-93cb-4f02-beb5-3c3902f8871e"
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
MethodOfLines = "94925ecb-adb7-4558-8ed8-f975c56a0bf4"

[targets]
test = ["Aqua", "Test", "CUDA", "SafeTestsets", "OptimizationOptimJL", "Pkg", "OrdinaryDiffEq", "LineSearches", "LuxCUDA", "Flux", "MethodOfLines"]
10 changes: 10 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
[deps]
AdvancedHMC = "0bf59076-c3b1-5ca4-86bd-e02cd72cde3d"
ComponentArrays = "b0b7db55-cfe3-40fc-9ded-d10e2dbeff66"
Cubature = "667455a9-e2ce-5579-9412-b964f529a492"
DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DomainSets = "5b8099bc-c8ec-5219-889f-1d9e522a28bf"
Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c"
Integrals = "de52edbc-65ea-441a-8357-d3a637375a31"
LineSearches = "d3d80556-e9d4-5f37-9878-2ab0fcc64255"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Lux = "b2108857-7c20-44ae-9111-449ecde12c47"
LuxCUDA = "d0bbae9a-e099-4d5b-a835-1c6931763bda"
MethodOfLines = "94925ecb-adb7-4558-8ed8-f975c56a0bf4"
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
MonteCarloMeasurements = "0987c9cc-fe09-11e8-30f0-b96dd679fdca"
NeuralPDE = "315f7962-48a3-4962-8226-d0f33b1235f0"
Expand All @@ -19,19 +23,24 @@ OptimizationPolyalgorithms = "500b13db-7e66-49ce-bda4-eed966be6282"
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
QuasiMonteCarlo = "8a4e6c94-4038-4cdc-81c3-7e6ffdb2a71b"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Roots = "f2b01f46-fcfa-551c-844a-d8ac1e96c665"
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"

[compat]
AdvancedHMC = "0.6"
ComponentArrays = "0.15"
Cubature = "1.5"
DiffEqBase = "6.106"
Distributions = "0.25"
Documenter = "1"
DomainSets = "0.6, 0.7"
Flux = "0.14"
Integrals = "4"
LineSearches = "7.2"
Lux = "0.5"
LuxCUDA = "0.3"
MethodOfLines = "0.11"
ModelingToolkit = "9"
MonteCarloMeasurements = "1"
NeuralPDE = "5.3"
Expand All @@ -42,5 +51,6 @@ OptimizationPolyalgorithms = "0.2"
OrdinaryDiffEq = "6.31"
Plots = "1.36"
QuasiMonteCarlo = "0.3"
Random = "1"
Roots = "2.0"
SpecialFunctions = "2.1"
2 changes: 1 addition & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ makedocs(sitename = "NeuralPDE.jl",
authors = "#",
modules = [NeuralPDE],
clean = true, doctest = false, linkcheck = true,
warnonly = [:missing_docs, :example_block],
warnonly = [:missing_docs],
format = Documenter.HTML(assets = ["assets/favicon.ico"],
canonical = "https://docs.sciml.ai/NeuralPDE/stable/"),
pages = pages)
Expand Down
4 changes: 1 addition & 3 deletions docs/src/examples/3rd.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ callback = function (p, l)
return false
end
res = Optimization.solve(prob, Adam(0.01); callback = callback, maxiters = 2000)
res = Optimization.solve(prob, OptimizationOptimisers.Adam(0.01); maxiters = 2000)
phi = discretization.phi
```

Expand All @@ -67,5 +67,3 @@ x_plot = collect(xs)
plot(x_plot, u_real, title = "real")
plot!(x_plot, u_predict, title = "predict")
```

![hodeplot](https://user-images.githubusercontent.com/12683885/90276340-69bc3e00-de6c-11ea-89a7-7d291123a38b.png)
2 changes: 1 addition & 1 deletion docs/src/examples/heterogeneous.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ callback = function (p, l)
return false
end
res = Optimization.solve(prob, BFGS(); callback = callback, maxiters = 100)
res = Optimization.solve(prob, BFGS(); maxiters = 100)
```
4 changes: 1 addition & 3 deletions docs/src/examples/ks.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ callback = function (p, l)
end
opt = OptimizationOptimJL.BFGS()
res = Optimization.solve(prob, opt; callback = callback, maxiters = 2000)
res = Optimization.solve(prob, opt; maxiters = 2000)
phi = discretization.phi
```

Expand All @@ -93,5 +93,3 @@ p2 = plot(xs, u_real, title = "analytic")
p3 = plot(xs, diff_u, title = "error")
plot(p1, p2, p3)
```

![plotks](https://user-images.githubusercontent.com/12683885/91025889-a6253200-e602-11ea-8f61-8e6e2488e025.png)
27 changes: 16 additions & 11 deletions docs/src/examples/linear_parabolic.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ w(t, 1) = \frac{e^{\lambda_1} cos(\frac{x}{a})-e^{\lambda_2}cos(\frac{x}{a})}{\l

with a physics-informed neural network.

```@example
using NeuralPDE, Lux, ModelingToolkit, Optimization, OptimizationOptimJL
```@example linear_parabolic
using NeuralPDE, Lux, ModelingToolkit, Optimization, OptimizationOptimisers, OptimizationOptimJL, LineSearches
using Plots
import ModelingToolkit: Interval, infimum, supremum
using ModelingToolkit: Interval, infimum, supremum
@parameters t, x
@variables u(..), w(..)
Expand Down Expand Up @@ -71,7 +71,7 @@ input_ = length(domains)
n = 15
chain = [Lux.Chain(Dense(input_, n, Lux.σ), Dense(n, n, Lux.σ), Dense(n, 1)) for _ in 1:2]
strategy = QuadratureTraining()
strategy = StochasticTraining(500)
discretization = PhysicsInformedNN(chain, strategy)
@named pdesystem = PDESystem(eqs, bcs, domains, [t, x], [u(t, x), w(t, x)])
Expand All @@ -85,14 +85,14 @@ global iteration = 0
callback = function (p, l)
if iteration % 10 == 0
println("loss: ", l)
println("pde_losses: ", map(l_ -> l_(p), pde_inner_loss_functions))
println("bcs_losses: ", map(l_ -> l_(p), bcs_inner_loss_functions))
println("pde_losses: ", map(l_ -> l_(p.u), pde_inner_loss_functions))
println("bcs_losses: ", map(l_ -> l_(p.u), bcs_inner_loss_functions))
end
global iteration += 1
return false
end
res = Optimization.solve(prob, BFGS(); callback = callback, maxiters = 5000)
res = Optimization.solve(prob, OptimizationOptimisers.Adam(1e-2); maxiters = 10000)
phi = discretization.phi
Expand All @@ -105,14 +105,19 @@ analytic_sol_func(t, x) = [u_analytic(t, x), w_analytic(t, x)]
u_real = [[analytic_sol_func(t, x)[i] for t in ts for x in xs] for i in 1:2]
u_predict = [[phi[i]([t, x], minimizers_[i])[1] for t in ts for x in xs] for i in 1:2]
diff_u = [abs.(u_real[i] .- u_predict[i]) for i in 1:2]
ps = []
for i in 1:2
p1 = plot(ts, xs, u_real[i], linetype = :contourf, title = "u$i, analytic")
p2 = plot(ts, xs, u_predict[i], linetype = :contourf, title = "predict")
p3 = plot(ts, xs, diff_u[i], linetype = :contourf, title = "error")
plot(p1, p2, p3)
savefig("sol_u$i")
push!(ps, plot(p1, p2, p3))
end
```

![linear_parabolic_sol_u1](https://user-images.githubusercontent.com/26853713/125745625-49c73760-0522-4ed4-9bdd-bcc567c9ace3.png)
![linear_parabolic_sol_u2](https://user-images.githubusercontent.com/26853713/125745637-b12e1d06-e27b-46fe-89f3-076d415fcd7e.png)
```@example linear_parabolic
ps[1]
```

```@example linear_parabolic
ps[2]
```
Loading

0 comments on commit 945c75c

Please sign in to comment.