Skip to content

Commit

Permalink
update BPINN_PDEinvsol_tests.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
AstitvaAggarwal committed Mar 29, 2024
1 parent efbccda commit 39ed5f6
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 37 deletions.
2 changes: 1 addition & 1 deletion src/training_strategies.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ end

# include dataset points in pde_residual loglikelihood (BayesianPINN)
function merge_strategy_with_loglikelihood_function(pinnrep::PINNRepresentation,
strategy,
strategy::GridTraining,
datafree_pde_loss_function,
datafree_bc_loss_function; train_sets_pde = nothing, train_sets_bc = nothing)
@unpack domains, eqs, bcs, dict_indvars, dict_depvars, flat_init_params = pinnrep
Expand Down
73 changes: 37 additions & 36 deletions test/BPINN_PDEinvsol_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,42 +34,43 @@ Random.seed!(100)
u1 = u1 .+ (u1 .* 0.2) .* randn(size(u1))
dataset = [hcat(u1, timepoints)]

# checking all training strategies
discretization = BayesianPINN([chainl], StochasticTraining(200), param_estim = true,
dataset = [dataset, nothing])

ahmc_bayesian_pinn_pde(pde_system,
discretization;
draw_samples = 1500,
bcstd = [0.05],
phystd = [0.01], l2std = [0.01],
priorsNNw = (0.0, 1.0),
saveats = [1 / 50.0],
param = [LogNormal(6.0, 0.5)])

discretization = BayesianPINN([chainl], QuasiRandomTraining(200), param_estim = true,
dataset = [dataset, nothing])

ahmc_bayesian_pinn_pde(pde_system,
discretization;
draw_samples = 1500,
bcstd = [0.05],
phystd = [0.01], l2std = [0.01],
priorsNNw = (0.0, 1.0),
saveats = [1 / 50.0],
param = [LogNormal(6.0, 0.5)])

discretization = BayesianPINN([chainl], QuadratureTraining(), param_estim = true,
dataset = [dataset, nothing])

ahmc_bayesian_pinn_pde(pde_system,
discretization;
draw_samples = 1500,
bcstd = [0.05],
phystd = [0.01], l2std = [0.01],
priorsNNw = (0.0, 1.0),
saveats = [1 / 50.0],
param = [LogNormal(6.0, 0.5)])
# TODO: correct implementations
# # checking all training strategies
# discretization = BayesianPINN([chainl], StochasticTraining(200), param_estim = true,
# dataset = [dataset, nothing])

# ahmc_bayesian_pinn_pde(pde_system,
# discretization;
# draw_samples = 1500,
# bcstd = [0.05],
# phystd = [0.01], l2std = [0.01],
# priorsNNw = (0.0, 1.0),
# saveats = [1 / 50.0],
# param = [LogNormal(6.0, 0.5)])

# discretization = BayesianPINN([chainl], QuasiRandomTraining(200), param_estim = true,
# dataset = [dataset, nothing])

# ahmc_bayesian_pinn_pde(pde_system,
# discretization;
# draw_samples = 1500,
# bcstd = [0.05],
# phystd = [0.01], l2std = [0.01],
# priorsNNw = (0.0, 1.0),
# saveats = [1 / 50.0],
# param = [LogNormal(6.0, 0.5)])

# discretization = BayesianPINN([chainl], QuadratureTraining(), param_estim = true,
# dataset = [dataset, nothing])

# ahmc_bayesian_pinn_pde(pde_system,
# discretization;
# draw_samples = 1500,
# bcstd = [0.05],
# phystd = [0.01], l2std = [0.01],
# priorsNNw = (0.0, 1.0),
# saveats = [1 / 50.0],
# param = [LogNormal(6.0, 0.5)])

discretization = BayesianPINN([chainl], GridTraining([0.02]), param_estim = true,
dataset = [dataset, nothing])
Expand Down

0 comments on commit 39ed5f6

Please sign in to comment.