Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
odunbar committed Sep 6, 2024
1 parent a113479 commit e29c7d3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions examples/Darcy/emulate_sample.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ function main()
println("case: ", case)
min_iter = 1
max_iter = 5 # number of EKP iterations to use data from is at most this

exp_name = "darcy"
rng_seed = 940284
rng = Random.MersenneTwister(rng_seed)

# loading relevant data
homedir = pwd()
println(homedir)
Expand All @@ -64,7 +64,7 @@ function main()
N, L = 80, 1.0
pts_per_dim = LinRange(0, L, N)
obs_ΔN = 10
darcy = Setup_Param(pts_per_dim, obs_ΔN, truth_params_constrained )
darcy = Setup_Param(pts_per_dim, obs_ΔN, truth_params_constrained)


n_params = length(truth_params) # "input dim"
Expand Down Expand Up @@ -104,7 +104,7 @@ function main()
retained_svd_frac = retained_svd_frac,
decorrelate = decorrelate,
)
optimize_hyperparameters!(emulator, kernbounds = [fill(-1e2, n_params+1), fill(1e2, n_params+1)])
optimize_hyperparameters!(emulator, kernbounds = [fill(-1e2, n_params + 1), fill(1e2, n_params + 1)])

# Check how well the Gaussian Process regression predicts on the
# true parameters
Expand Down Expand Up @@ -134,7 +134,7 @@ function main()

# First let's run a short chain to determine a good step size
mcmc = MCMCWrapper(RWMHSampling(), truth_sample, prior, emulator; init_params = u0)
# mcmc = MCMCWrapper(pCNMHSampling(), truth_sample, prior, emulator; init_params = u0)
# mcmc = MCMCWrapper(pCNMHSampling(), truth_sample, prior, emulator; init_params = u0)
new_step = optimize_stepsize(mcmc; init_stepsize = 0.1, N = 2000, discard_initial = 0)

# Now begin the actual MCMC
Expand Down Expand Up @@ -185,7 +185,7 @@ function main()

h_2d = solve_Darcy_2D(darcy, κ_ens_mean)
p3 = contour(pts_per_dim, pts_per_dim, h_2d', fill = true, levels = 15, title = "pressure", colorbar = true)

l = @layout [a b c]
plt = plot(p1, p2, p3, layout = l)
savefig(plt, joinpath(data_save_directory, "$(case)_posterior_pointwise_uq.png"))
Expand Down

0 comments on commit e29c7d3

Please sign in to comment.