Skip to content

Commit

Permalink
Clean-up and test reference files changes
Browse files Browse the repository at this point in the history
  • Loading branch information
JordiBolibar committed Dec 11, 2023
1 parent bc34f51 commit 4eab427
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions test/PDE_UDE_solve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,6 @@ function pde_solve_test(; rtol::F, atol::F, save_refs::Bool=false, MB::Bool=fals
PDE_refs = load(joinpath(Huginn.root_dir, "test/data/PDE/PDE_refs_noMB.jld2"))["results"]
end

# # Run one epoch of the UDE training
# θ = zeros(10) # dummy data for the NN
# UA_f = zeros(10)
# UDE_settings, train_settings = Huginn.get_default_training_settings!(gdirs)
# context_batches = Huginn.get_UDE_context(gdirs, tspan; testmode=true, velocities=false)
# H_V_preds = @time predict_iceflow(θ, UA_f, gdirs, context_batches, UDE_settings, mb_model) # Array{(H_pred, V̄x_pred, V̄y_pred, rgi_id)}

let results=prediction.results

for result in results
Expand All @@ -87,21 +80,12 @@ function pde_solve_test(; rtol::F, atol::F, save_refs::Bool=false, MB::Bool=fals
plot_test_error(result, test_ref, "H", result.rgi_id, atol, MB)
plot_test_error(result, test_ref, "Vx", result.rgi_id, vtol, MB)
plot_test_error(result, test_ref, "Vy", result.rgi_id, vtol, MB)

### UDE ###
# Huginn.plot_test_error(UDE_pred, test_ref, "H", rgi_id, atol, MB)
# Huginn.plot_test_error(UDE_pred, test_ref, "Vx", rgi_id, vtol, MB)
# Huginn.plot_test_error(UDE_pred, test_ref, "Vy", rgi_id, vtol, MB)

# Test that the PDE simulations are correct
@test all(isapprox.(result.H[end], test_ref.H[end], rtol=rtol, atol=atol))
@test all(isapprox.(result.Vx, test_ref.Vx, rtol=rtol, atol=vtol))
@test all(isapprox.(result.Vy, test_ref.Vy, rtol=rtol, atol=vtol))

# Test that the UDE simulations are correct
# @test all(isapprox.(UDE_pred[1], test_ref["H"], atol=atol))
# @test all(isapprox.(UDE_pred[2], test_ref["Vx"], atol=vtol))
# @test all(isapprox.(UDE_pred[3], test_ref["Vy"], atol=vtol))
end # let
end
end
Expand Down
Binary file modified test/data/PDE/PDE_refs_MB.jld2
Binary file not shown.
Binary file modified test/data/PDE/PDE_refs_noMB.jld2
Binary file not shown.

0 comments on commit 4eab427

Please sign in to comment.