Skip to content

Commit

Permalink
change naming convections
Browse files Browse the repository at this point in the history
  • Loading branch information
sandreza committed Jan 8, 2021
1 parent 8b0b980 commit 921e3b6
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions examples/LossMinimization/loss_minimization.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using Distributions
using LinearAlgebra
using Random
using Test
using Plots
using CalibrateEmulateSample.EKP
using CalibrateEmulateSample.EnsembleKalmanProcesses
using CalibrateEmulateSample.ParameterDistributionStorage
# Seed for pseudo-random number generator for reproducibility
rng_seed = 41
Expand Down Expand Up @@ -38,16 +37,16 @@ prior_cov = get_cov(prior)
# Calibrate
N_ens = 50 # number of ensemble members
N_iter = 20 # number of EKI iterations
initial_ensemble = EKP.construct_initial_ensemble(prior, N_ens;
initial_ensemble = EnsembleKalmanProcesses.construct_initial_ensemble(prior, N_ens;
rng_seed=rng_seed)

ekiobj = EKP.EKObj(initial_ensemble,
ekiobj = EnsembleKalmanProcesses.EnsembleKalmanProcess(initial_ensemble,
y_obs, Γy, Inversion())
#
for i in 1:N_iter
params_i = ekiobj.u[end]
g_ens = hcat([G(params_i[i,:]) for i in 1:N_ens]...)'
EKP.update_ensemble!(ekiobj, g_ens)
EnsembleKalmanProcesses.update_ensemble!(ekiobj, g_ens)
end

for i in eachindex(ekiobj.u)
Expand Down Expand Up @@ -87,16 +86,16 @@ prior_cov = get_cov(prior)
# Calibrate
N_ens = 50 # number of ensemble members
N_iter = 40 # number of EKI iterations
initial_ensemble = EKP.construct_initial_ensemble(prior, N_ens;
initial_ensemble = EnsembleKalmanProcesses.construct_initial_ensemble(prior, N_ens;
rng_seed=rng_seed)

ekiobj = EKP.EKObj(initial_ensemble,
ekiobj = EnsembleKalmanProcesses.EnsembleKalmanProcess(initial_ensemble,
y_obs, Γy, Inversion())
#
for i in 1:N_iter
params_i = ekiobj.u[end]
g_ens = hcat([G(params_i[i,:]) for i in 1:N_ens]...)'
EKP.update_ensemble!(ekiobj, g_ens)
EnsembleKalmanProcesses.update_ensemble!(ekiobj, g_ens)
end

for i in eachindex(ekiobj.u)
Expand Down

0 comments on commit 921e3b6

Please sign in to comment.