From 808008df43c4775bd54c6b4fa1bf8601b3e50e08 Mon Sep 17 00:00:00 2001 From: Sathvik Bhagavan Date: Thu, 14 Mar 2024 06:39:29 +0000 Subject: [PATCH 1/5] ci: add Downgrade CI --- .github/workflows/Downgrade.yml | 60 +++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .github/workflows/Downgrade.yml diff --git a/.github/workflows/Downgrade.yml b/.github/workflows/Downgrade.yml new file mode 100644 index 0000000000..190d11e1f6 --- /dev/null +++ b/.github/workflows/Downgrade.yml @@ -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 From 55017b45b375b79219de950aaf9c105fc12556d6 Mon Sep 17 00:00:00 2001 From: Sathvik Bhagavan Date: Thu, 14 Mar 2024 06:45:21 +0000 Subject: [PATCH 2/5] build: update compats of packages --- Project.toml | 56 ++++++++++++++++++++++++++-------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/Project.toml b/Project.toml index 6545930693..d76565ff25 100644 --- a/Project.toml +++ b/Project.toml @@ -40,50 +40,50 @@ 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.18" +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.14" +LuxCUDA = "0.3.2" MCMCChains = "6" -ModelingToolkit = "8" -MonteCarloMeasurements = "1" +MethodOfLines = "0.10.7" +ModelingToolkit = "8.75" +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.10.7" -julia = "1.6" +Zygote = "0.6.68" +julia = "1.10" [extras] Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" From a89afeb52ca843da64af64f4d981019b5c73b1de Mon Sep 17 00:00:00 2001 From: Sathvik Bhagavan Date: Fri, 15 Mar 2024 06:11:00 +0000 Subject: [PATCH 3/5] docs: fix rendering of dgm example --- docs/src/tutorials/dgm.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/src/tutorials/dgm.md b/docs/src/tutorials/dgm.md index 1917df8f43..cb853d0099 100644 --- a/docs/src/tutorials/dgm.md +++ b/docs/src/tutorials/dgm.md @@ -28,15 +28,15 @@ where $\vec{x}$ is the concatenated vector of $(t, x)$ and $L$ is the number of Let's try to solve the following Burger's equation using Deep Galerkin Method for $\alpha = 0.05$ and compare our solution with the finite difference method: -$$ +```math \partial_t u(t, x) + u(t, x) \partial_x u(t, x) - \alpha \partial_{xx} u(t, x) = 0 -$$ +``` defined over -$$ +```math t \in [0, 1], x \in [-1, 1] -$$ +``` with boundary conditions ```math From fe39bcc0ce754721cbb343935b2e2f02860de4e3 Mon Sep 17 00:00:00 2001 From: Sathvik Bhagavan Date: Fri, 15 Mar 2024 06:11:21 +0000 Subject: [PATCH 4/5] docs: remove example block from warnonly --- docs/make.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/make.jl b/docs/make.jl index 3b1340c277..dfa8087f3f 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -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) From bfb159c19077536324ca720e6a4b84eb7af1ad2c Mon Sep 17 00:00:00 2001 From: Sathvik Bhagavan Date: Fri, 15 Mar 2024 06:26:14 +0000 Subject: [PATCH 5/5] docs: fix rendering of Bayesian PINN docstrings --- src/BPINN_ode.jl | 34 ++++++++++++++++++---------------- src/advancedHMC_MCMC.jl | 4 ++-- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/src/BPINN_ode.jl b/src/BPINN_ode.jl index 4493a07326..3bbf1afea8 100644 --- a/src/BPINN_ode.jl +++ b/src/BPINN_ode.jl @@ -123,18 +123,19 @@ function BNNODE(chain, Kernel = HMC; strategy = nothing, draw_samples = 2000, end """ -Contains ahmc_bayesian_pinn_ode() function output: -1> a MCMCChains.jl chain object for sampled parameters -2> The set of all sampled parameters -3> statistics like: - > n_steps - > acceptance_rate - > log_density - > hamiltonian_energy - > hamiltonian_energy_error - > numerical_error - > step_size - > nom_step_size +Contains `ahmc_bayesian_pinn_ode()` function output: + +1. A MCMCChains.jl chain object for sampled parameters. +2. The set of all sampled parameters. +3. Statistics like: + - n_steps + - acceptance_rate + - log_density + - hamiltonian_energy + - hamiltonian_energy_error + - numerical_error + - step_size + - nom_step_size """ struct BPINNstats{MC, S, ST} mcmc_chain::MC @@ -143,10 +144,11 @@ struct BPINNstats{MC, S, ST} end """ -BPINN Solution contains the original solution from AdvancedHMC.jl sampling(BPINNstats contains fields related to that) -> ensemblesol is the Probabilistic Estimate(MonteCarloMeasurements.jl Particles type) of Ensemble solution from All Neural Network's(made using all sampled parameters) output's. -> estimated_nn_params - Probabilistic Estimate of NN params from sampled weights,biases -> estimated_de_params - Probabilistic Estimate of DE params from sampled unknown DE parameters +BPINN Solution contains the original solution from AdvancedHMC.jl sampling (BPINNstats contains fields related to that). + +1. `ensemblesol` is the Probabilistic Estimate (MonteCarloMeasurements.jl Particles type) of Ensemble solution from All Neural Network's (made using all sampled parameters) output's. +2. `estimated_nn_params` - Probabilistic Estimate of NN params from sampled weights, biases. +3. `estimated_de_params` - Probabilistic Estimate of DE params from sampled unknown DE parameters. """ struct BPINNsolution{O <: BPINNstats, E, NP, OP, P} original::O diff --git a/src/advancedHMC_MCMC.jl b/src/advancedHMC_MCMC.jl index c051d208ca..6f30149257 100644 --- a/src/advancedHMC_MCMC.jl +++ b/src/advancedHMC_MCMC.jl @@ -344,8 +344,8 @@ end !!! warn - Note that ahmc_bayesian_pinn_ode() only supports ODEs which are written in the out-of-place form, i.e. - `du = f(u,p,t)`, and not `f(du,u,p,t)`. If not declared out-of-place, then the ahmc_bayesian_pinn_ode() + Note that `ahmc_bayesian_pinn_ode()` only supports ODEs which are written in the out-of-place form, i.e. + `du = f(u,p,t)`, and not `f(du,u,p,t)`. If not declared out-of-place, then the `ahmc_bayesian_pinn_ode()` will exit with an error. ## Example