Skip to content

Commit

Permalink
test fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
odunbar committed Jun 2, 2023
1 parent e1754b2 commit 4ea2d81
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 8 additions & 1 deletion test/EnsembleKalmanProcess/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,14 @@ end
for (scheduler, N_iter) in zip(schedulers, N_iters)
println("Scheduler: ", nameof(typeof(scheduler)))
if !(nameof(typeof(process)) == Symbol(Unscented))
ekpobj = EKP.EnsembleKalmanProcess(initial_ensemble, y_obs, Γy, process, rng = copy(rng), scheduler = scheduler)
ekpobj = EKP.EnsembleKalmanProcess(
initial_ensemble,
y_obs,
Γy,
process,
rng = copy(rng),
scheduler = scheduler,
)
else #no initial ensemble for UKI
ekpobj = EKP.EnsembleKalmanProcess(y_obs, Γy, process, rng = copy(rng), scheduler = scheduler)
end
Expand Down
3 changes: 0 additions & 3 deletions test/SparseInversion/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ include("../EnsembleKalmanProcess/inverse_problem.jl")
if !isnothing(terminated)
break
end
println(i, " ", ekiobj.Δt[end])

end
push!(init_means, vec(mean(get_u_prior(ekiobj), dims = 2)))
Expand All @@ -201,8 +200,6 @@ include("../EnsembleKalmanProcess/inverse_problem.jl")
for i in 1:length(final_means)
u_star = transform_constrained_to_unconstrained(prior, ϕ_star)
inv_sqrt_Γy = sqrt(inv(Γy))
println(norm(inv_sqrt_Γy * (y_obs .- G(transform_unconstrained_to_constrained(prior, final_means[i])))) )
println(norm(inv_sqrt_Γy * (y_obs .- G(transform_unconstrained_to_constrained(prior, init_means[i])))) )
# @test norm(u_star - final_means[i]) < norm(u_star - init_means[i])
@test norm(inv_sqrt_Γy * (y_obs .- G(transform_unconstrained_to_constrained(prior, final_means[i])))) <
norm(inv_sqrt_Γy * (y_obs .- G(transform_unconstrained_to_constrained(prior, init_means[i]))))
Expand Down

0 comments on commit 4ea2d81

Please sign in to comment.