Skip to content

Commit

Permalink
add more noise in data
Browse files Browse the repository at this point in the history
  • Loading branch information
AstitvaAggarwal committed Sep 5, 2024
1 parent 1fef5b2 commit 4de5691
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/advancedHMC_MCMC.jl
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ function ahmc_bayesian_pinn_ode(prob::SciMLBase.ODEProblem, chain;
@info("Current Prior Log-likelihood : ", priorweights(ℓπ, samples[end]))
@info("Current MSE against dataset Log-likelihood : ", L2LossData(ℓπ, samples[end]))
if estim_collocate
@info("Current gradient loss against dataset Log-likelihood : ", L2loss2(ℓπ, initial_θ))
@info("Current gradient loss against dataset Log-likelihood : ", L2loss2(ℓπ, samples[end]))
end

# return a chain(basic chain),samples and stats
Expand Down
12 changes: 6 additions & 6 deletions test/BPINN_Tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ end
sol = solve(prob, Tsit5(); saveat = 0.1)
u = sol.u
time = sol.t
= u .+ (0.15 .* randn(size(u)))
= u .+ (0.3 .* randn(size(u)))
dataset = [x̂, time]
physsol1 = [linear_analytic(prob.u0, p, time[i]) for i in eachindex(time)]

Expand All @@ -280,7 +280,7 @@ end
priorsNNw = (0.0,
10.0),
param = [
Normal(-7, 4)
Normal(-7, 2)
])

fh_mcmc_chainlux22, fhsampleslux22, fhstatslux22 = ahmc_bayesian_pinn_ode(
Expand All @@ -292,7 +292,7 @@ end
priorsNNw = (0.0,
10.0),
param = [
Normal(-7, 4)
Normal(-7, 2)
], estim_collocate = true)

alg = BNNODE(chainlux12,
Expand All @@ -303,7 +303,7 @@ end
priorsNNw = (0.0,
10.0),
param = [
Normal(-7, 4)
Normal(-7, 2)
], estim_collocate = true)

sol3lux_pestim = solve(prob, alg)
Expand Down Expand Up @@ -369,8 +369,8 @@ end

times = solution.t
u = hcat(solution.u...)
x = u[1, :] + (0.5 .* randn(length(u[1, :])))
y = u[2, :] + (0.5 .* randn(length(u[2, :])))
x = u[1, :] + (0.8 .* randn(length(u[1, :])))
y = u[2, :] + (0.8 .* randn(length(u[2, :])))
dataset = [x, y, times]

chain = Lux.Chain(Lux.Dense(1, 6, tanh), Lux.Dense(6, 6, tanh),
Expand Down

0 comments on commit 4de5691

Please sign in to comment.