Skip to content

Commit

Permalink
typos
Browse files Browse the repository at this point in the history
  • Loading branch information
KirillZubov authored and avik-pal committed Oct 13, 2024
1 parent 052dd9a commit 7c7cde8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/PDE_BPINN.jl
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ function L2LossData(Tar::PDELogTargetDensity, θ)

# Phi is the trial solution for each NN in chain array
# Creating logpdf( MvNormal(Phi(t,θ),std), dataset[i] )
# dataset[i][:, 2:end] -> indepvar cols of a particular depvar's dataset
# dataset[i][:, 2:end] -> indepvar cols of a particular depvar's dataset
# dataset[i][:, 1] -> depvar col of depvar's dataset

if Tar.extraparams > 0
Expand Down Expand Up @@ -251,7 +251,7 @@ end
Adaptorkwargs = (Adaptor = StanHMCAdaptor,
Metric = DiagEuclideanMetric, targetacceptancerate = 0.8),
Integratorkwargs = (Integrator = Leapfrog,), saveats = [1 / 10.0],
numensemble = floor(Int, draw_samples / 3), progress = false, verbose = false)
numensemble = floor(Int, draw_samples / 3), progress = false, verbose = false)
## NOTES
Expand Down Expand Up @@ -329,7 +329,7 @@ function ahmc_bayesian_pinn_pde(pde_system, discretization;
Φ = pinnrep.phi

# for new L2 loss
# discretization.additional_loss =
# discretization.additional_loss =

if nchains < 1
throw(error("number of chains must be greater than or equal to 1"))
Expand All @@ -356,7 +356,7 @@ function ahmc_bayesian_pinn_pde(pde_system, discretization;
# append Ode params to all paramvector - initial_θ
if ninv > 0
# shift ode params(initialise ode params by prior means)
# check if means or user speified is better
# check if means or user specified is better
initial_θ = vcat(initial_θ, [Distributions.params(param[i])[1] for i in 1:ninv])
priors = vcat(priors, param)
nparameters += ninv
Expand All @@ -365,7 +365,7 @@ function ahmc_bayesian_pinn_pde(pde_system, discretization;
# vector in case of N-dimensional domains
strategy = discretization.strategy

# dimensions would be total no of params,initial_nnθ for Lux namedTuples
# dimensions would be total no of params,initial_nnθ for Lux namedTuples
ℓπ = PDELogTargetDensity(nparameters,
strategy,
dataset,
Expand Down
2 changes: 1 addition & 1 deletion src/discretize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ function get_bounds(domains, eqs, bcs, eltypeθ, dict_indvars, dict_depvars,
end
pde_upper_bounds = map(pde_args) do pd
span = map(p -> get(dict_upper_bound, p, p), pd)
map(s -> adapt(eltypeθ, s) + cbrt(eps(eltypeθ)), span)
map(s -> adapt(eltypeθ, s) - cbrt(eps(eltypeθ)), span)
end
pde_bounds = [pde_lower_bounds, pde_upper_bounds]

Expand Down
4 changes: 2 additions & 2 deletions test/BPINN_Tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ end
dataset = [x̂, time]
physsol1 = [linear_analytic(prob.u0, p, time[i]) for i in eachindex(time)]

# seperate set of points for testing the solve() call (it uses saveat 1/50 hence here length 501)
# separate set of points for testing the solve() call (it uses saveat 1/50 hence here length 501)
time1 = vec(collect(Float64, range(tspan[1], tspan[2], length = 501)))
physsol2 = [linear_analytic(prob.u0, p, time1[i]) for i in eachindex(time1)]

Expand Down Expand Up @@ -264,7 +264,7 @@ end
dataset = [x̂, time]
physsol1 = [linear_analytic(prob.u0, p, time[i]) for i in eachindex(time)]

# seperate set of points for testing the solve() call (it uses saveat 1/50 hence here length 501)
# separate set of points for testing the solve() call (it uses saveat 1/50 hence here length 501)
time1 = vec(collect(Float64, range(tspan[1], tspan[2], length = 501)))
physsol2 = [linear_analytic(prob.u0, p, time1[i]) for i in eachindex(time1)]

Expand Down

0 comments on commit 7c7cde8

Please sign in to comment.