diff --git a/experiments_NGN/AD1D/dump_rswaf/evolve_e1_case1.png b/experiments_NGN/AD1D/dump_tanh/evolve_e1_case1.png similarity index 100% rename from experiments_NGN/AD1D/dump_rswaf/evolve_e1_case1.png rename to experiments_NGN/AD1D/dump_tanh/evolve_e1_case1.png diff --git a/experiments_NGN/AD1D/dump_rswaf/evolve_e1_case2.png b/experiments_NGN/AD1D/dump_tanh/evolve_e1_case2.png similarity index 100% rename from experiments_NGN/AD1D/dump_rswaf/evolve_e1_case2.png rename to experiments_NGN/AD1D/dump_tanh/evolve_e1_case2.png diff --git a/experiments_NGN/AD1D/dump_rswaf/evolve_e1_case3.png b/experiments_NGN/AD1D/dump_tanh/evolve_e1_case3.png similarity index 100% rename from experiments_NGN/AD1D/dump_rswaf/evolve_e1_case3.png rename to experiments_NGN/AD1D/dump_tanh/evolve_e1_case3.png diff --git a/experiments_NGN/AD1D/dump_rswaf/evolve_e1_case5.png b/experiments_NGN/AD1D/dump_tanh/evolve_e1_case5.png similarity index 100% rename from experiments_NGN/AD1D/dump_rswaf/evolve_e1_case5.png rename to experiments_NGN/AD1D/dump_tanh/evolve_e1_case5.png diff --git a/experiments_NGN/AD1D/dump_rswaf/evolve_e1_case6.png b/experiments_NGN/AD1D/dump_tanh/evolve_e1_case6.png similarity index 100% rename from experiments_NGN/AD1D/dump_rswaf/evolve_e1_case6.png rename to experiments_NGN/AD1D/dump_tanh/evolve_e1_case6.png diff --git a/experiments_NGN/AD1D/dump_rswaf/evolve_e1_case7.png b/experiments_NGN/AD1D/dump_tanh/evolve_e1_case7.png similarity index 100% rename from experiments_NGN/AD1D/dump_rswaf/evolve_e1_case7.png rename to experiments_NGN/AD1D/dump_tanh/evolve_e1_case7.png diff --git a/experiments_NGN/AD1D/dump_rswaf/evolve_u1_case1.png b/experiments_NGN/AD1D/dump_tanh/evolve_u1_case1.png similarity index 100% rename from experiments_NGN/AD1D/dump_rswaf/evolve_u1_case1.png rename to experiments_NGN/AD1D/dump_tanh/evolve_u1_case1.png diff --git a/experiments_NGN/AD1D/dump_rswaf/evolve_u1_case2.png b/experiments_NGN/AD1D/dump_tanh/evolve_u1_case2.png similarity index 100% rename from experiments_NGN/AD1D/dump_rswaf/evolve_u1_case2.png rename to experiments_NGN/AD1D/dump_tanh/evolve_u1_case2.png diff --git a/experiments_NGN/AD1D/dump_rswaf/evolve_u1_case3.png b/experiments_NGN/AD1D/dump_tanh/evolve_u1_case3.png similarity index 100% rename from experiments_NGN/AD1D/dump_rswaf/evolve_u1_case3.png rename to experiments_NGN/AD1D/dump_tanh/evolve_u1_case3.png diff --git a/experiments_NGN/AD1D/dump_rswaf/evolve_u1_case5.png b/experiments_NGN/AD1D/dump_tanh/evolve_u1_case5.png similarity index 100% rename from experiments_NGN/AD1D/dump_rswaf/evolve_u1_case5.png rename to experiments_NGN/AD1D/dump_tanh/evolve_u1_case5.png diff --git a/experiments_NGN/AD1D/dump_rswaf/evolve_u1_case6.png b/experiments_NGN/AD1D/dump_tanh/evolve_u1_case6.png similarity index 100% rename from experiments_NGN/AD1D/dump_rswaf/evolve_u1_case6.png rename to experiments_NGN/AD1D/dump_tanh/evolve_u1_case6.png diff --git a/experiments_NGN/AD1D/dump_rswaf/evolve_u1_case7.png b/experiments_NGN/AD1D/dump_tanh/evolve_u1_case7.png similarity index 100% rename from experiments_NGN/AD1D/dump_rswaf/evolve_u1_case7.png rename to experiments_NGN/AD1D/dump_tanh/evolve_u1_case7.png diff --git a/experiments_NGN/AD1D/dump_rswaf/project1/plt1.png b/experiments_NGN/AD1D/dump_tanh/project1/plt1.png similarity index 100% rename from experiments_NGN/AD1D/dump_rswaf/project1/plt1.png rename to experiments_NGN/AD1D/dump_tanh/project1/plt1.png diff --git a/experiments_NGN/AD1D/dump_rswaf/project1/plt_training.png b/experiments_NGN/AD1D/dump_tanh/project1/plt_training.png similarity index 100% rename from experiments_NGN/AD1D/dump_rswaf/project1/plt_training.png rename to experiments_NGN/AD1D/dump_tanh/project1/plt_training.png diff --git a/experiments_NGN/AD1D/dump_rswaf/project1/statistics.txt b/experiments_NGN/AD1D/dump_tanh/project1/statistics.txt similarity index 100% rename from experiments_NGN/AD1D/dump_rswaf/project1/statistics.txt rename to experiments_NGN/AD1D/dump_tanh/project1/statistics.txt diff --git a/experiments_NGN/AD1D/dump_rswaf/project2/plt1.png b/experiments_NGN/AD1D/dump_tanh/project2/plt1.png similarity index 100% rename from experiments_NGN/AD1D/dump_rswaf/project2/plt1.png rename to experiments_NGN/AD1D/dump_tanh/project2/plt1.png diff --git a/experiments_NGN/AD1D/dump_rswaf/project2/plt_training.png b/experiments_NGN/AD1D/dump_tanh/project2/plt_training.png similarity index 100% rename from experiments_NGN/AD1D/dump_rswaf/project2/plt_training.png rename to experiments_NGN/AD1D/dump_tanh/project2/plt_training.png diff --git a/experiments_NGN/AD1D/dump_rswaf/project2/statistics.txt b/experiments_NGN/AD1D/dump_tanh/project2/statistics.txt similarity index 100% rename from experiments_NGN/AD1D/dump_rswaf/project2/statistics.txt rename to experiments_NGN/AD1D/dump_tanh/project2/statistics.txt diff --git a/experiments_NGN/AD1D/dump_rswaf/project3/plt1.png b/experiments_NGN/AD1D/dump_tanh/project3/plt1.png similarity index 100% rename from experiments_NGN/AD1D/dump_rswaf/project3/plt1.png rename to experiments_NGN/AD1D/dump_tanh/project3/plt1.png diff --git a/experiments_NGN/AD1D/dump_rswaf/project3/plt_training.png b/experiments_NGN/AD1D/dump_tanh/project3/plt_training.png similarity index 100% rename from experiments_NGN/AD1D/dump_rswaf/project3/plt_training.png rename to experiments_NGN/AD1D/dump_tanh/project3/plt_training.png diff --git a/experiments_NGN/AD1D/dump_rswaf/project3/statistics.txt b/experiments_NGN/AD1D/dump_tanh/project3/statistics.txt similarity index 100% rename from experiments_NGN/AD1D/dump_rswaf/project3/statistics.txt rename to experiments_NGN/AD1D/dump_tanh/project3/statistics.txt diff --git a/experiments_NGN/AD1D/dump_rswaf/project5/plt1.png b/experiments_NGN/AD1D/dump_tanh/project5/plt1.png similarity index 100% rename from experiments_NGN/AD1D/dump_rswaf/project5/plt1.png rename to experiments_NGN/AD1D/dump_tanh/project5/plt1.png diff --git a/experiments_NGN/AD1D/dump_rswaf/project5/plt_training.png b/experiments_NGN/AD1D/dump_tanh/project5/plt_training.png similarity index 100% rename from experiments_NGN/AD1D/dump_rswaf/project5/plt_training.png rename to experiments_NGN/AD1D/dump_tanh/project5/plt_training.png diff --git a/experiments_NGN/AD1D/dump_rswaf/project5/statistics.txt b/experiments_NGN/AD1D/dump_tanh/project5/statistics.txt similarity index 100% rename from experiments_NGN/AD1D/dump_rswaf/project5/statistics.txt rename to experiments_NGN/AD1D/dump_tanh/project5/statistics.txt diff --git a/experiments_NGN/AD1D/dump_rswaf/project6/plt1.png b/experiments_NGN/AD1D/dump_tanh/project6/plt1.png similarity index 100% rename from experiments_NGN/AD1D/dump_rswaf/project6/plt1.png rename to experiments_NGN/AD1D/dump_tanh/project6/plt1.png diff --git a/experiments_NGN/AD1D/dump_rswaf/project6/plt_training.png b/experiments_NGN/AD1D/dump_tanh/project6/plt_training.png similarity index 100% rename from experiments_NGN/AD1D/dump_rswaf/project6/plt_training.png rename to experiments_NGN/AD1D/dump_tanh/project6/plt_training.png diff --git a/experiments_NGN/AD1D/dump_rswaf/project6/statistics.txt b/experiments_NGN/AD1D/dump_tanh/project6/statistics.txt similarity index 100% rename from experiments_NGN/AD1D/dump_rswaf/project6/statistics.txt rename to experiments_NGN/AD1D/dump_tanh/project6/statistics.txt diff --git a/experiments_NGN/AD1D/dump_rswaf/project7/plt1.png b/experiments_NGN/AD1D/dump_tanh/project7/plt1.png similarity index 100% rename from experiments_NGN/AD1D/dump_rswaf/project7/plt1.png rename to experiments_NGN/AD1D/dump_tanh/project7/plt1.png diff --git a/experiments_NGN/AD1D/dump_rswaf/project7/plt_training.png b/experiments_NGN/AD1D/dump_tanh/project7/plt_training.png similarity index 100% rename from experiments_NGN/AD1D/dump_rswaf/project7/plt_training.png rename to experiments_NGN/AD1D/dump_tanh/project7/plt_training.png diff --git a/experiments_NGN/AD1D/dump_rswaf/project7/statistics.txt b/experiments_NGN/AD1D/dump_tanh/project7/statistics.txt similarity index 100% rename from experiments_NGN/AD1D/dump_rswaf/project7/statistics.txt rename to experiments_NGN/AD1D/dump_tanh/project7/statistics.txt diff --git a/experiments_NGN/AD1D/run.jl b/experiments_NGN/AD1D/run.jl index fb58c256..46765266 100644 --- a/experiments_NGN/AD1D/run.jl +++ b/experiments_NGN/AD1D/run.jl @@ -26,21 +26,20 @@ data_kws = (; Ix = :, It = :) # modeldir = joinpath(@__DIR__, "dump_dnn") #------------------------------------------------------# -# RSWAF +# Tanh Kernels #------------------------------------------------------# # data_kws = (; Ix = LinRange(1, 512, 64), It = LinRange(1, 500, 500)) # data_kws = map(x -> round.(Int, x), data_kws) -train_params = (; type = :RSWAF) +train_params = (;) evolve_params = (; scheme = :GalerkinCollocation) -# evolve_params = (; timealg = RungeKutta4())#, Δt = 1e-3, adaptive = false) -makemodel = makemodelGaussian +makemodel = makemodelTanh modelfilename = "model_05.jld2" -modeldir = joinpath(@__DIR__, "dump_rswaf") +modeldir = joinpath(@__DIR__, "dump_tanh") #------------------------------------------------------# -# Gaussian +# Gaussian Kernels #------------------------------------------------------# # data_kws = (; Ix = LinRange(1, 512, 64), It = LinRange(1, 500, 500)) # data_kws = map(x -> round.(Int, x), data_kws) @@ -54,7 +53,7 @@ modeldir = joinpath(@__DIR__, "dump_rswaf") # modeldir = joinpath(@__DIR__, "dump_gaussian") #------------------------------------------------------# -# Gaussian (exact) +# Gaussian (exact IC) #------------------------------------------------------# # data_kws = (; Ix = LinRange(1, 256, 64), It = LinRange(1, 500, 500)) # data_kws = map(x -> round.(Int, x), data_kws) @@ -104,24 +103,5 @@ for case in 5:7 # sleep(2) end -#======================================================# -# -# ARCHITECTURE -# - Check out multiplicative feature networks. -# Maybe they can speed-up SDF type problems. -# -# GAUSSIAN REFINEMENT/CULLING -# - -# -# HYPER-REDUCTION -# - Each Gaussian needs ~5 points to be evolved properly. This should be -# helpful in hyper-reduction. We should do local sampling around each -# Gaussian. That is: uniformly pick 5 x ∈ [x̄ - 2σ, x̄ + 2σ] -# -# LITERATURE -# - Check out Gaussian process literature -# -# NEW CONTRIB -# - Make parameterization probabilistic. Then you get UQ for free. #======================================================# nothing diff --git a/experiments_NGN/Burg1D/dump_gaussian/evolve_e1_case1.png b/experiments_NGN/Burg1D/dump_gaussian/evolve_e1_case1.png deleted file mode 100644 index 4b028332..00000000 Binary files a/experiments_NGN/Burg1D/dump_gaussian/evolve_e1_case1.png and /dev/null differ diff --git a/experiments_NGN/Burg1D/dump_gaussian/evolve_u1_case1.png b/experiments_NGN/Burg1D/dump_gaussian/evolve_u1_case1.png deleted file mode 100644 index 1e61e39d..00000000 Binary files a/experiments_NGN/Burg1D/dump_gaussian/evolve_u1_case1.png and /dev/null differ diff --git a/experiments_NGN/Burg1D/dump_gaussian/project1/plt1.png b/experiments_NGN/Burg1D/dump_gaussian/project1/plt1.png deleted file mode 100644 index e9f015ef..00000000 Binary files a/experiments_NGN/Burg1D/dump_gaussian/project1/plt1.png and /dev/null differ diff --git a/experiments_NGN/Burg1D/dump_gaussian/project1/plt_training.png b/experiments_NGN/Burg1D/dump_gaussian/project1/plt_training.png deleted file mode 100644 index b508efa3..00000000 Binary files a/experiments_NGN/Burg1D/dump_gaussian/project1/plt_training.png and /dev/null differ diff --git a/experiments_NGN/Burg1D/dump_gaussian/project1/statistics.txt b/experiments_NGN/Burg1D/dump_gaussian/project1/statistics.txt deleted file mode 100644 index 9b34d84e..00000000 --- a/experiments_NGN/Burg1D/dump_gaussian/project1/statistics.txt +++ /dev/null @@ -1,110 +0,0 @@ -CHECKPOINT 01 -Epoch [0 / 0] TRAIN LOSS: 1.949894e-6 || TEST LOSS: 1.949894e-6 -#======================# -TRAIN STATS -R² score: 0.99998438 -MSE (mean SQR error): 1.949894e-6 -RMSE (Root MSE): 0.001396386 -MAE (mean ABS error): 0.0010440017 -maxAE (max ABS error) 0.0046298783 -Lipschitz bound: 1.0 - -#======================# -#======================# -TEST STATS -R² score: 0.99998438 -MSE (mean SQR error): 1.949894e-6 -RMSE (Root MSE): 0.001396386 -MAE (mean ABS error): 0.0010440017 -maxAE (max ABS error) 0.0046298783 -Lipschitz bound: 1.0 - -#======================# -CHECKPOINT 02 -Epoch [0 / 0] TRAIN LOSS: 6.6649773e-7 || TEST LOSS: 6.6649773e-7 -#======================# -TRAIN STATS -R² score: 0.99999467 -MSE (mean SQR error): 6.6649773e-7 -RMSE (Root MSE): 0.00081639312 -MAE (mean ABS error): 0.0005959351 -maxAE (max ABS error) 0.0027451934 -Lipschitz bound: 1.0 - -#======================# -#======================# -TEST STATS -R² score: 0.99999467 -MSE (mean SQR error): 6.6649773e-7 -RMSE (Root MSE): 0.00081639312 -MAE (mean ABS error): 0.0005959351 -maxAE (max ABS error) 0.0027451934 -Lipschitz bound: 1.0 - -#======================# -CHECKPOINT 03 -Epoch [0 / 0] TRAIN LOSS: 4.2328771e-7 || TEST LOSS: 4.2328771e-7 -#======================# -TRAIN STATS -R² score: 0.99999661 -MSE (mean SQR error): 4.2328771e-7 -RMSE (Root MSE): 0.00065060565 -MAE (mean ABS error): 0.00038113617 -maxAE (max ABS error) 0.0028631957 -Lipschitz bound: 1.0 - -#======================# -#======================# -TEST STATS -R² score: 0.99999661 -MSE (mean SQR error): 4.2328771e-7 -RMSE (Root MSE): 0.00065060565 -MAE (mean ABS error): 0.00038113617 -maxAE (max ABS error) 0.0028631957 -Lipschitz bound: 1.0 - -#======================# -CHECKPOINT 04 -Epoch [0 / 0] TRAIN LOSS: 4.0574244e-7 || TEST LOSS: 4.0574244e-7 -#======================# -TRAIN STATS -R² score: 0.99999675 -MSE (mean SQR error): 4.0574244e-7 -RMSE (Root MSE): 0.00063697915 -MAE (mean ABS error): 0.00037075355 -maxAE (max ABS error) 0.0028780466 -Lipschitz bound: 1.0 - -#======================# -#======================# -TEST STATS -R² score: 0.99999675 -MSE (mean SQR error): 4.0574244e-7 -RMSE (Root MSE): 0.00063697915 -MAE (mean ABS error): 0.00037075355 -maxAE (max ABS error) 0.0028780466 -Lipschitz bound: 1.0 - -#======================# -CHECKPOINT 05 -Epoch [0 / 0] TRAIN LOSS: 3.9581881e-7 || TEST LOSS: 3.9581881e-7 -#======================# -TRAIN STATS -R² score: 0.99999683 -MSE (mean SQR error): 3.9581881e-7 -RMSE (Root MSE): 0.00062914133 -MAE (mean ABS error): 0.00038441396 -maxAE (max ABS error) 0.0026198858 -Lipschitz bound: 1.0 - -#======================# -#======================# -TEST STATS -R² score: 0.99999683 -MSE (mean SQR error): 3.9581881e-7 -RMSE (Root MSE): 0.00062914133 -MAE (mean ABS error): 0.00038441396 -maxAE (max ABS error) 0.0026198858 -Lipschitz bound: 1.0 - -#======================# diff --git a/experiments_NGN/Burg1D/dump_rswaf/evolve_e1_case1.png b/experiments_NGN/Burg1D/dump_rswaf/evolve_e1_case1.png deleted file mode 100644 index b68dd174..00000000 Binary files a/experiments_NGN/Burg1D/dump_rswaf/evolve_e1_case1.png and /dev/null differ diff --git a/experiments_NGN/Burg1D/dump_rswaf/evolve_u1_case1.png b/experiments_NGN/Burg1D/dump_rswaf/evolve_u1_case1.png deleted file mode 100644 index 07445e06..00000000 Binary files a/experiments_NGN/Burg1D/dump_rswaf/evolve_u1_case1.png and /dev/null differ diff --git a/experiments_NGN/Burg1D/dump_rswaf/project1/plt1.png b/experiments_NGN/Burg1D/dump_rswaf/project1/plt1.png deleted file mode 100644 index c6e8c90f..00000000 Binary files a/experiments_NGN/Burg1D/dump_rswaf/project1/plt1.png and /dev/null differ diff --git a/experiments_NGN/Burg1D/dump_rswaf/project1/plt_training.png b/experiments_NGN/Burg1D/dump_rswaf/project1/plt_training.png deleted file mode 100644 index c4a34cd7..00000000 Binary files a/experiments_NGN/Burg1D/dump_rswaf/project1/plt_training.png and /dev/null differ diff --git a/experiments_NGN/Burg1D/dump_rswaf/project1/statistics.txt b/experiments_NGN/Burg1D/dump_rswaf/project1/statistics.txt deleted file mode 100644 index a36ff530..00000000 --- a/experiments_NGN/Burg1D/dump_rswaf/project1/statistics.txt +++ /dev/null @@ -1,110 +0,0 @@ -CHECKPOINT 01 -Epoch [0 / 0] TRAIN LOSS: 8.685539e-5 || TEST LOSS: 8.685539e-5 -#======================# -TRAIN STATS -R² score: 0.99930412 -MSE (mean SQR error): 8.685539e-5 -RMSE (Root MSE): 0.0093196239 -MAE (mean ABS error): 0.0066925088 -maxAE (max ABS error) 0.03372338 -Lipschitz bound: 1.0 - -#======================# -#======================# -TEST STATS -R² score: 0.99930412 -MSE (mean SQR error): 8.685539e-5 -RMSE (Root MSE): 0.0093196239 -MAE (mean ABS error): 0.0066925088 -maxAE (max ABS error) 0.03372338 -Lipschitz bound: 1.0 - -#======================# -CHECKPOINT 02 -Epoch [0 / 0] TRAIN LOSS: 7.8877835e-5 || TEST LOSS: 7.8877835e-5 -#======================# -TRAIN STATS -R² score: 0.99936879 -MSE (mean SQR error): 7.8877835e-5 -RMSE (Root MSE): 0.0088813194 -MAE (mean ABS error): 0.005817965 -maxAE (max ABS error) 0.034176428 -Lipschitz bound: 1.0 - -#======================# -#======================# -TEST STATS -R² score: 0.99936879 -MSE (mean SQR error): 7.8877835e-5 -RMSE (Root MSE): 0.0088813194 -MAE (mean ABS error): 0.005817965 -maxAE (max ABS error) 0.034176428 -Lipschitz bound: 1.0 - -#======================# -CHECKPOINT 03 -Epoch [0 / 0] TRAIN LOSS: 7.7871003e-5 || TEST LOSS: 7.7871003e-5 -#======================# -TRAIN STATS -R² score: 0.99937705 -MSE (mean SQR error): 7.7871003e-5 -RMSE (Root MSE): 0.0088244548 -MAE (mean ABS error): 0.0057886761 -maxAE (max ABS error) 0.033680126 -Lipschitz bound: 1.0 - -#======================# -#======================# -TEST STATS -R² score: 0.99937705 -MSE (mean SQR error): 7.7871003e-5 -RMSE (Root MSE): 0.0088244548 -MAE (mean ABS error): 0.0057886761 -maxAE (max ABS error) 0.033680126 -Lipschitz bound: 1.0 - -#======================# -CHECKPOINT 04 -Epoch [0 / 0] TRAIN LOSS: 7.7663607e-5 || TEST LOSS: 7.7663607e-5 -#======================# -TRAIN STATS -R² score: 0.99937822 -MSE (mean SQR error): 7.7663607e-5 -RMSE (Root MSE): 0.0088126958 -MAE (mean ABS error): 0.0057799396 -maxAE (max ABS error) 0.033761978 -Lipschitz bound: 1.0 - -#======================# -#======================# -TEST STATS -R² score: 0.99937822 -MSE (mean SQR error): 7.7663607e-5 -RMSE (Root MSE): 0.0088126958 -MAE (mean ABS error): 0.0057799396 -maxAE (max ABS error) 0.033761978 -Lipschitz bound: 1.0 - -#======================# -CHECKPOINT 05 -Epoch [0 / 0] TRAIN LOSS: 7.5410615e-5 || TEST LOSS: 7.5410615e-5 -#======================# -TRAIN STATS -R² score: 0.9993961 -MSE (mean SQR error): 7.5410615e-5 -RMSE (Root MSE): 0.0086839285 -MAE (mean ABS error): 0.0052774903 -maxAE (max ABS error) 0.033703797 -Lipschitz bound: 1.0 - -#======================# -#======================# -TEST STATS -R² score: 0.9993961 -MSE (mean SQR error): 7.5410615e-5 -RMSE (Root MSE): 0.0086839285 -MAE (mean ABS error): 0.0052774903 -maxAE (max ABS error) 0.033703797 -Lipschitz bound: 1.0 - -#======================# diff --git a/experiments_NGN/Burg1D/dump_tanh/evolve_e1_case1.png b/experiments_NGN/Burg1D/dump_tanh/evolve_e1_case1.png new file mode 100644 index 00000000..8d739d0b Binary files /dev/null and b/experiments_NGN/Burg1D/dump_tanh/evolve_e1_case1.png differ diff --git a/experiments_NGN/Burg1D/dump_tanh/evolve_e1_case2.png b/experiments_NGN/Burg1D/dump_tanh/evolve_e1_case2.png new file mode 100644 index 00000000..a081420b Binary files /dev/null and b/experiments_NGN/Burg1D/dump_tanh/evolve_e1_case2.png differ diff --git a/experiments_NGN/Burg1D/dump_tanh/evolve_u1_case1.png b/experiments_NGN/Burg1D/dump_tanh/evolve_u1_case1.png new file mode 100644 index 00000000..31c1c7ed Binary files /dev/null and b/experiments_NGN/Burg1D/dump_tanh/evolve_u1_case1.png differ diff --git a/experiments_NGN/Burg1D/dump_tanh/evolve_u1_case2.png b/experiments_NGN/Burg1D/dump_tanh/evolve_u1_case2.png new file mode 100644 index 00000000..40c02d72 Binary files /dev/null and b/experiments_NGN/Burg1D/dump_tanh/evolve_u1_case2.png differ diff --git a/experiments_NGN/Burg1D/dump_tanh/project1/plt1.png b/experiments_NGN/Burg1D/dump_tanh/project1/plt1.png new file mode 100644 index 00000000..fa855170 Binary files /dev/null and b/experiments_NGN/Burg1D/dump_tanh/project1/plt1.png differ diff --git a/experiments_NGN/Burg1D/dump_tanh/project1/split0/plt_training.png b/experiments_NGN/Burg1D/dump_tanh/project1/split0/plt_training.png new file mode 100644 index 00000000..86c6c8de Binary files /dev/null and b/experiments_NGN/Burg1D/dump_tanh/project1/split0/plt_training.png differ diff --git a/experiments_NGN/Burg1D/dump_tanh/project1/split0/statistics.txt b/experiments_NGN/Burg1D/dump_tanh/project1/split0/statistics.txt new file mode 100644 index 00000000..05cc0698 --- /dev/null +++ b/experiments_NGN/Burg1D/dump_tanh/project1/split0/statistics.txt @@ -0,0 +1,110 @@ +CHECKPOINT 01 +Epoch [0 / 0] TRAIN LOSS: 0.00016998869 || TEST LOSS: 0.00016998869 +#======================# +TRAIN STATS +R² score: 0.99863902 +MSE (mean SQR error): 0.00016998869 +RMSE (Root MSE): 0.013037971 +MAE (mean ABS error): 0.0098726759 +maxAE (max ABS error) 0.034802139 +Lipschitz bound: 1.0 + +#======================# +#======================# +TEST STATS +R² score: 0.99863902 +MSE (mean SQR error): 0.00016998869 +RMSE (Root MSE): 0.013037971 +MAE (mean ABS error): 0.0098726759 +maxAE (max ABS error) 0.034802139 +Lipschitz bound: 1.0 + +#======================# +CHECKPOINT 02 +Epoch [0 / 0] TRAIN LOSS: 0.00016858064 || TEST LOSS: 0.00016858064 +#======================# +TRAIN STATS +R² score: 0.99865213 +MSE (mean SQR error): 0.00016858064 +RMSE (Root MSE): 0.012983861 +MAE (mean ABS error): 0.010191589 +maxAE (max ABS error) 0.033603411 +Lipschitz bound: 1.0 + +#======================# +#======================# +TEST STATS +R² score: 0.99865213 +MSE (mean SQR error): 0.00016858064 +RMSE (Root MSE): 0.012983861 +MAE (mean ABS error): 0.010191589 +maxAE (max ABS error) 0.033603411 +Lipschitz bound: 1.0 + +#======================# +CHECKPOINT 03 +Epoch [0 / 0] TRAIN LOSS: 0.00016835895 || TEST LOSS: 0.00016835895 +#======================# +TRAIN STATS +R² score: 0.99865061 +MSE (mean SQR error): 0.00016835895 +RMSE (Root MSE): 0.012975321 +MAE (mean ABS error): 0.010319232 +maxAE (max ABS error) 0.033478078 +Lipschitz bound: 1.0 + +#======================# +#======================# +TEST STATS +R² score: 0.99865061 +MSE (mean SQR error): 0.00016835895 +RMSE (Root MSE): 0.012975321 +MAE (mean ABS error): 0.010319232 +maxAE (max ABS error) 0.033478078 +Lipschitz bound: 1.0 + +#======================# +CHECKPOINT 04 +Epoch [0 / 0] TRAIN LOSS: 0.00016817819 || TEST LOSS: 0.00016817819 +#======================# +TRAIN STATS +R² score: 0.99865308 +MSE (mean SQR error): 0.00016817819 +RMSE (Root MSE): 0.012968353 +MAE (mean ABS error): 0.01027797 +maxAE (max ABS error) 0.033458792 +Lipschitz bound: 1.0 + +#======================# +#======================# +TEST STATS +R² score: 0.99865308 +MSE (mean SQR error): 0.00016817819 +RMSE (Root MSE): 0.012968353 +MAE (mean ABS error): 0.01027797 +maxAE (max ABS error) 0.033458792 +Lipschitz bound: 1.0 + +#======================# +CHECKPOINT 05 +Epoch [0 / 0] TRAIN LOSS: 0.00016815641 || TEST LOSS: 0.00016815641 +#======================# +TRAIN STATS +R² score: 0.99865294 +MSE (mean SQR error): 0.00016815641 +RMSE (Root MSE): 0.012967514 +MAE (mean ABS error): 0.010268515 +maxAE (max ABS error) 0.033389043 +Lipschitz bound: 1.0 + +#======================# +#======================# +TEST STATS +R² score: 0.99865294 +MSE (mean SQR error): 0.00016815641 +RMSE (Root MSE): 0.012967514 +MAE (mean ABS error): 0.010268515 +maxAE (max ABS error) 0.033389043 +Lipschitz bound: 1.0 + +#======================# diff --git a/experiments_NGN/Burg1D/dump_tanh/project1/split1/plt_training.png b/experiments_NGN/Burg1D/dump_tanh/project1/split1/plt_training.png new file mode 100644 index 00000000..cea8540d Binary files /dev/null and b/experiments_NGN/Burg1D/dump_tanh/project1/split1/plt_training.png differ diff --git a/experiments_NGN/Burg1D/dump_tanh/project1/split1/statistics.txt b/experiments_NGN/Burg1D/dump_tanh/project1/split1/statistics.txt new file mode 100644 index 00000000..1c8cf124 --- /dev/null +++ b/experiments_NGN/Burg1D/dump_tanh/project1/split1/statistics.txt @@ -0,0 +1,110 @@ +CHECKPOINT 01 +Epoch [0 / 0] TRAIN LOSS: 2.6410703e-5 || TEST LOSS: 2.6410703e-5 +#======================# +TRAIN STATS +R² score: 0.99978711 +MSE (mean SQR error): 2.6410703e-5 +RMSE (Root MSE): 0.0051391345 +MAE (mean ABS error): 0.0036493896 +maxAE (max ABS error) 0.01648424 +Lipschitz bound: 1.0 + +#======================# +#======================# +TEST STATS +R² score: 0.99978711 +MSE (mean SQR error): 2.6410703e-5 +RMSE (Root MSE): 0.0051391345 +MAE (mean ABS error): 0.0036493896 +maxAE (max ABS error) 0.01648424 +Lipschitz bound: 1.0 + +#======================# +CHECKPOINT 02 +Epoch [0 / 0] TRAIN LOSS: 2.3091691e-5 || TEST LOSS: 2.3091691e-5 +#======================# +TRAIN STATS +R² score: 0.9998153 +MSE (mean SQR error): 2.3091691e-5 +RMSE (Root MSE): 0.0048053815 +MAE (mean ABS error): 0.0036315841 +maxAE (max ABS error) 0.015527004 +Lipschitz bound: 1.0 + +#======================# +#======================# +TEST STATS +R² score: 0.9998153 +MSE (mean SQR error): 2.3091691e-5 +RMSE (Root MSE): 0.0048053815 +MAE (mean ABS error): 0.0036315841 +maxAE (max ABS error) 0.015527004 +Lipschitz bound: 1.0 + +#======================# +CHECKPOINT 03 +Epoch [0 / 0] TRAIN LOSS: 2.2946858e-5 || TEST LOSS: 2.2946858e-5 +#======================# +TRAIN STATS +R² score: 0.99981642 +MSE (mean SQR error): 2.2946858e-5 +RMSE (Root MSE): 0.0047902879 +MAE (mean ABS error): 0.0034614161 +maxAE (max ABS error) 0.016137581 +Lipschitz bound: 1.0 + +#======================# +#======================# +TEST STATS +R² score: 0.99981642 +MSE (mean SQR error): 2.2946858e-5 +RMSE (Root MSE): 0.0047902879 +MAE (mean ABS error): 0.0034614161 +maxAE (max ABS error) 0.016137581 +Lipschitz bound: 1.0 + +#======================# +CHECKPOINT 04 +Epoch [0 / 0] TRAIN LOSS: 2.287727e-5 || TEST LOSS: 2.287727e-5 +#======================# +TRAIN STATS +R² score: 0.99981696 +MSE (mean SQR error): 2.287727e-5 +RMSE (Root MSE): 0.004783019 +MAE (mean ABS error): 0.0035034991 +maxAE (max ABS error) 0.015907915 +Lipschitz bound: 1.0 + +#======================# +#======================# +TEST STATS +R² score: 0.99981696 +MSE (mean SQR error): 2.287727e-5 +RMSE (Root MSE): 0.004783019 +MAE (mean ABS error): 0.0035034991 +maxAE (max ABS error) 0.015907915 +Lipschitz bound: 1.0 + +#======================# +CHECKPOINT 05 +Epoch [0 / 0] TRAIN LOSS: 2.2872482e-5 || TEST LOSS: 2.2872482e-5 +#======================# +TRAIN STATS +R² score: 0.99981699 +MSE (mean SQR error): 2.2872482e-5 +RMSE (Root MSE): 0.0047825184 +MAE (mean ABS error): 0.0035101776 +maxAE (max ABS error) 0.015859764 +Lipschitz bound: 1.0 + +#======================# +#======================# +TEST STATS +R² score: 0.99981699 +MSE (mean SQR error): 2.2872482e-5 +RMSE (Root MSE): 0.0047825184 +MAE (mean ABS error): 0.0035101776 +maxAE (max ABS error) 0.015859764 +Lipschitz bound: 1.0 + +#======================# diff --git a/experiments_NGN/Burg1D/dump_tanh/project1/split2/plt_training.png b/experiments_NGN/Burg1D/dump_tanh/project1/split2/plt_training.png new file mode 100644 index 00000000..94c2eecf Binary files /dev/null and b/experiments_NGN/Burg1D/dump_tanh/project1/split2/plt_training.png differ diff --git a/experiments_NGN/Burg1D/dump_tanh/project1/split2/statistics.txt b/experiments_NGN/Burg1D/dump_tanh/project1/split2/statistics.txt new file mode 100644 index 00000000..4cf52d0f --- /dev/null +++ b/experiments_NGN/Burg1D/dump_tanh/project1/split2/statistics.txt @@ -0,0 +1,110 @@ +CHECKPOINT 01 +Epoch [0 / 0] TRAIN LOSS: 8.4216465e-6 || TEST LOSS: 8.4216465e-6 +#======================# +TRAIN STATS +R² score: 0.99993271 +MSE (mean SQR error): 8.4216465e-6 +RMSE (Root MSE): 0.0029020073 +MAE (mean ABS error): 0.0016420308 +maxAE (max ABS error) 0.012096385 +Lipschitz bound: 1.0 + +#======================# +#======================# +TEST STATS +R² score: 0.99993271 +MSE (mean SQR error): 8.4216465e-6 +RMSE (Root MSE): 0.0029020073 +MAE (mean ABS error): 0.0016420308 +maxAE (max ABS error) 0.012096385 +Lipschitz bound: 1.0 + +#======================# +CHECKPOINT 02 +Epoch [0 / 0] TRAIN LOSS: 2.9037438e-6 || TEST LOSS: 2.9037438e-6 +#======================# +TRAIN STATS +R² score: 0.99997681 +MSE (mean SQR error): 2.9037438e-6 +RMSE (Root MSE): 0.0017040375 +MAE (mean ABS error): 0.0012395545 +maxAE (max ABS error) 0.0066396091 +Lipschitz bound: 1.0 + +#======================# +#======================# +TEST STATS +R² score: 0.99997681 +MSE (mean SQR error): 2.9037438e-6 +RMSE (Root MSE): 0.0017040375 +MAE (mean ABS error): 0.0012395545 +maxAE (max ABS error) 0.0066396091 +Lipschitz bound: 1.0 + +#======================# +CHECKPOINT 03 +Epoch [0 / 0] TRAIN LOSS: 2.68636e-6 || TEST LOSS: 2.68636e-6 +#======================# +TRAIN STATS +R² score: 0.99997851 +MSE (mean SQR error): 2.68636e-6 +RMSE (Root MSE): 0.0016390119 +MAE (mean ABS error): 0.0010693704 +maxAE (max ABS error) 0.0070578065 +Lipschitz bound: 1.0 + +#======================# +#======================# +TEST STATS +R² score: 0.99997851 +MSE (mean SQR error): 2.68636e-6 +RMSE (Root MSE): 0.0016390119 +MAE (mean ABS error): 0.0010693704 +maxAE (max ABS error) 0.0070578065 +Lipschitz bound: 1.0 + +#======================# +CHECKPOINT 04 +Epoch [0 / 0] TRAIN LOSS: 2.6485804e-6 || TEST LOSS: 2.6485804e-6 +#======================# +TRAIN STATS +R² score: 0.99997881 +MSE (mean SQR error): 2.6485804e-6 +RMSE (Root MSE): 0.001627446 +MAE (mean ABS error): 0.0010721315 +maxAE (max ABS error) 0.0069895545 +Lipschitz bound: 1.0 + +#======================# +#======================# +TEST STATS +R² score: 0.99997881 +MSE (mean SQR error): 2.6485804e-6 +RMSE (Root MSE): 0.001627446 +MAE (mean ABS error): 0.0010721315 +maxAE (max ABS error) 0.0069895545 +Lipschitz bound: 1.0 + +#======================# +CHECKPOINT 05 +Epoch [0 / 0] TRAIN LOSS: 2.3597063e-6 || TEST LOSS: 2.3597063e-6 +#======================# +TRAIN STATS +R² score: 0.99998112 +MSE (mean SQR error): 2.3597063e-6 +RMSE (Root MSE): 0.0015361335 +MAE (mean ABS error): 0.0010298427 +maxAE (max ABS error) 0.0059084739 +Lipschitz bound: 1.0 + +#======================# +#======================# +TEST STATS +R² score: 0.99998112 +MSE (mean SQR error): 2.3597063e-6 +RMSE (Root MSE): 0.0015361335 +MAE (mean ABS error): 0.0010298427 +maxAE (max ABS error) 0.0059084739 +Lipschitz bound: 1.0 + +#======================# diff --git a/experiments_NGN/Burg1D/dump_tanh/project2/plt1.png b/experiments_NGN/Burg1D/dump_tanh/project2/plt1.png new file mode 100644 index 00000000..2349dc74 Binary files /dev/null and b/experiments_NGN/Burg1D/dump_tanh/project2/plt1.png differ diff --git a/experiments_NGN/Burg1D/dump_tanh/project2/split0/plt_training.png b/experiments_NGN/Burg1D/dump_tanh/project2/split0/plt_training.png new file mode 100644 index 00000000..f5c4d4e6 Binary files /dev/null and b/experiments_NGN/Burg1D/dump_tanh/project2/split0/plt_training.png differ diff --git a/experiments_NGN/Burg1D/dump_tanh/project2/split0/statistics.txt b/experiments_NGN/Burg1D/dump_tanh/project2/split0/statistics.txt new file mode 100644 index 00000000..7217d6e7 --- /dev/null +++ b/experiments_NGN/Burg1D/dump_tanh/project2/split0/statistics.txt @@ -0,0 +1,110 @@ +CHECKPOINT 01 +Epoch [0 / 0] TRAIN LOSS: 0.00016998869 || TEST LOSS: 0.00016998869 +#======================# +TRAIN STATS +R² score: 0.99863902 +MSE (mean SQR error): 0.00016998869 +RMSE (Root MSE): 0.013037971 +MAE (mean ABS error): 0.0098726759 +maxAE (max ABS error) 0.034802139 +Lipschitz bound: 1.0 + +#======================# +#======================# +TEST STATS +R² score: 0.99863902 +MSE (mean SQR error): 0.00016998869 +RMSE (Root MSE): 0.013037971 +MAE (mean ABS error): 0.0098726759 +maxAE (max ABS error) 0.034802139 +Lipschitz bound: 1.0 + +#======================# +CHECKPOINT 02 +Epoch [0 / 0] TRAIN LOSS: 0.00016858061 || TEST LOSS: 0.00016858061 +#======================# +TRAIN STATS +R² score: 0.99865213 +MSE (mean SQR error): 0.00016858061 +RMSE (Root MSE): 0.01298386 +MAE (mean ABS error): 0.010191594 +maxAE (max ABS error) 0.033603363 +Lipschitz bound: 1.0 + +#======================# +#======================# +TEST STATS +R² score: 0.99865213 +MSE (mean SQR error): 0.00016858061 +RMSE (Root MSE): 0.01298386 +MAE (mean ABS error): 0.010191594 +maxAE (max ABS error) 0.033603363 +Lipschitz bound: 1.0 + +#======================# +CHECKPOINT 03 +Epoch [0 / 0] TRAIN LOSS: 0.00016835903 || TEST LOSS: 0.00016835903 +#======================# +TRAIN STATS +R² score: 0.99865061 +MSE (mean SQR error): 0.00016835903 +RMSE (Root MSE): 0.012975324 +MAE (mean ABS error): 0.010319246 +maxAE (max ABS error) 0.033478048 +Lipschitz bound: 1.0 + +#======================# +#======================# +TEST STATS +R² score: 0.99865061 +MSE (mean SQR error): 0.00016835903 +RMSE (Root MSE): 0.012975324 +MAE (mean ABS error): 0.010319246 +maxAE (max ABS error) 0.033478048 +Lipschitz bound: 1.0 + +#======================# +CHECKPOINT 04 +Epoch [0 / 0] TRAIN LOSS: 0.00016817821 || TEST LOSS: 0.00016817821 +#======================# +TRAIN STATS +R² score: 0.99865308 +MSE (mean SQR error): 0.00016817821 +RMSE (Root MSE): 0.012968354 +MAE (mean ABS error): 0.010277973 +maxAE (max ABS error) 0.033458784 +Lipschitz bound: 1.0 + +#======================# +#======================# +TEST STATS +R² score: 0.99865308 +MSE (mean SQR error): 0.00016817821 +RMSE (Root MSE): 0.012968354 +MAE (mean ABS error): 0.010277973 +maxAE (max ABS error) 0.033458784 +Lipschitz bound: 1.0 + +#======================# +CHECKPOINT 05 +Epoch [0 / 0] TRAIN LOSS: 0.00016815641 || TEST LOSS: 0.00016815641 +#======================# +TRAIN STATS +R² score: 0.99865294 +MSE (mean SQR error): 0.00016815641 +RMSE (Root MSE): 0.012967514 +MAE (mean ABS error): 0.010268455 +maxAE (max ABS error) 0.033390254 +Lipschitz bound: 1.0 + +#======================# +#======================# +TEST STATS +R² score: 0.99865294 +MSE (mean SQR error): 0.00016815641 +RMSE (Root MSE): 0.012967514 +MAE (mean ABS error): 0.010268455 +maxAE (max ABS error) 0.033390254 +Lipschitz bound: 1.0 + +#======================# diff --git a/experiments_NGN/Burg1D/dump_tanh/project2/split1/plt_training.png b/experiments_NGN/Burg1D/dump_tanh/project2/split1/plt_training.png new file mode 100644 index 00000000..342c8d9f Binary files /dev/null and b/experiments_NGN/Burg1D/dump_tanh/project2/split1/plt_training.png differ diff --git a/experiments_NGN/Burg1D/dump_tanh/project2/split1/statistics.txt b/experiments_NGN/Burg1D/dump_tanh/project2/split1/statistics.txt new file mode 100644 index 00000000..8df87f6e --- /dev/null +++ b/experiments_NGN/Burg1D/dump_tanh/project2/split1/statistics.txt @@ -0,0 +1,110 @@ +CHECKPOINT 01 +Epoch [0 / 0] TRAIN LOSS: 2.8075292e-5 || TEST LOSS: 2.8075292e-5 +#======================# +TRAIN STATS +R² score: 0.99977352 +MSE (mean SQR error): 2.8075292e-5 +RMSE (Root MSE): 0.0052986123 +MAE (mean ABS error): 0.0037620476 +maxAE (max ABS error) 0.017461557 +Lipschitz bound: 1.0 + +#======================# +#======================# +TEST STATS +R² score: 0.99977352 +MSE (mean SQR error): 2.8075292e-5 +RMSE (Root MSE): 0.0052986123 +MAE (mean ABS error): 0.0037620476 +maxAE (max ABS error) 0.017461557 +Lipschitz bound: 1.0 + +#======================# +CHECKPOINT 02 +Epoch [0 / 0] TRAIN LOSS: 2.3571549e-5 || TEST LOSS: 2.3571549e-5 +#======================# +TRAIN STATS +R² score: 0.99981152 +MSE (mean SQR error): 2.3571549e-5 +RMSE (Root MSE): 0.0048550539 +MAE (mean ABS error): 0.0035830994 +maxAE (max ABS error) 0.016435629 +Lipschitz bound: 1.0 + +#======================# +#======================# +TEST STATS +R² score: 0.99981152 +MSE (mean SQR error): 2.3571549e-5 +RMSE (Root MSE): 0.0048550539 +MAE (mean ABS error): 0.0035830994 +maxAE (max ABS error) 0.016435629 +Lipschitz bound: 1.0 + +#======================# +CHECKPOINT 03 +Epoch [0 / 0] TRAIN LOSS: 2.350194e-5 || TEST LOSS: 2.350194e-5 +#======================# +TRAIN STATS +R² score: 0.999812 +MSE (mean SQR error): 2.350194e-5 +RMSE (Root MSE): 0.0048478799 +MAE (mean ABS error): 0.00345628 +maxAE (max ABS error) 0.016766407 +Lipschitz bound: 1.0 + +#======================# +#======================# +TEST STATS +R² score: 0.999812 +MSE (mean SQR error): 2.350194e-5 +RMSE (Root MSE): 0.0048478799 +MAE (mean ABS error): 0.00345628 +maxAE (max ABS error) 0.016766407 +Lipschitz bound: 1.0 + +#======================# +CHECKPOINT 04 +Epoch [0 / 0] TRAIN LOSS: 2.3341919e-5 || TEST LOSS: 2.3341919e-5 +#======================# +TRAIN STATS +R² score: 0.99981323 +MSE (mean SQR error): 2.3341919e-5 +RMSE (Root MSE): 0.0048313475 +MAE (mean ABS error): 0.0034844791 +maxAE (max ABS error) 0.01643683 +Lipschitz bound: 1.0 + +#======================# +#======================# +TEST STATS +R² score: 0.99981323 +MSE (mean SQR error): 2.3341919e-5 +RMSE (Root MSE): 0.0048313475 +MAE (mean ABS error): 0.0034844791 +maxAE (max ABS error) 0.01643683 +Lipschitz bound: 1.0 + +#======================# +CHECKPOINT 05 +Epoch [0 / 0] TRAIN LOSS: 2.2848906e-5 || TEST LOSS: 2.2848906e-5 +#======================# +TRAIN STATS +R² score: 0.99981718 +MSE (mean SQR error): 2.2848906e-5 +RMSE (Root MSE): 0.0047800529 +MAE (mean ABS error): 0.0035196805 +maxAE (max ABS error) 0.01573213 +Lipschitz bound: 1.0 + +#======================# +#======================# +TEST STATS +R² score: 0.99981718 +MSE (mean SQR error): 2.2848906e-5 +RMSE (Root MSE): 0.0047800529 +MAE (mean ABS error): 0.0035196805 +maxAE (max ABS error) 0.01573213 +Lipschitz bound: 1.0 + +#======================# diff --git a/experiments_NGN/Burg1D/dump_tanh/project2/split2/plt_training.png b/experiments_NGN/Burg1D/dump_tanh/project2/split2/plt_training.png new file mode 100644 index 00000000..6aeee238 Binary files /dev/null and b/experiments_NGN/Burg1D/dump_tanh/project2/split2/plt_training.png differ diff --git a/experiments_NGN/Burg1D/dump_tanh/project2/split2/statistics.txt b/experiments_NGN/Burg1D/dump_tanh/project2/split2/statistics.txt new file mode 100644 index 00000000..78a9d0f3 --- /dev/null +++ b/experiments_NGN/Burg1D/dump_tanh/project2/split2/statistics.txt @@ -0,0 +1,110 @@ +CHECKPOINT 01 +Epoch [0 / 0] TRAIN LOSS: 1.117863e-5 || TEST LOSS: 1.117863e-5 +#======================# +TRAIN STATS +R² score: 0.99991005 +MSE (mean SQR error): 1.117863e-5 +RMSE (Root MSE): 0.0033434458 +MAE (mean ABS error): 0.002278704 +maxAE (max ABS error) 0.011645166 +Lipschitz bound: 1.0 + +#======================# +#======================# +TEST STATS +R² score: 0.99991005 +MSE (mean SQR error): 1.117863e-5 +RMSE (Root MSE): 0.0033434458 +MAE (mean ABS error): 0.002278704 +maxAE (max ABS error) 0.011645166 +Lipschitz bound: 1.0 + +#======================# +CHECKPOINT 02 +Epoch [0 / 0] TRAIN LOSS: 3.9412276e-6 || TEST LOSS: 3.9412276e-6 +#======================# +TRAIN STATS +R² score: 0.99996844 +MSE (mean SQR error): 3.9412276e-6 +RMSE (Root MSE): 0.0019852525 +MAE (mean ABS error): 0.0011357928 +maxAE (max ABS error) 0.0085227536 +Lipschitz bound: 1.0 + +#======================# +#======================# +TEST STATS +R² score: 0.99996844 +MSE (mean SQR error): 3.9412276e-6 +RMSE (Root MSE): 0.0019852525 +MAE (mean ABS error): 0.0011357928 +maxAE (max ABS error) 0.0085227536 +Lipschitz bound: 1.0 + +#======================# +CHECKPOINT 03 +Epoch [0 / 0] TRAIN LOSS: 3.1821561e-6 || TEST LOSS: 3.1821561e-6 +#======================# +TRAIN STATS +R² score: 0.99997454 +MSE (mean SQR error): 3.1821561e-6 +RMSE (Root MSE): 0.0017838599 +MAE (mean ABS error): 0.0010746149 +maxAE (max ABS error) 0.0076765912 +Lipschitz bound: 1.0 + +#======================# +#======================# +TEST STATS +R² score: 0.99997454 +MSE (mean SQR error): 3.1821561e-6 +RMSE (Root MSE): 0.0017838599 +MAE (mean ABS error): 0.0010746149 +maxAE (max ABS error) 0.0076765912 +Lipschitz bound: 1.0 + +#======================# +CHECKPOINT 04 +Epoch [0 / 0] TRAIN LOSS: 3.0111332e-6 || TEST LOSS: 3.0111332e-6 +#======================# +TRAIN STATS +R² score: 0.99997591 +MSE (mean SQR error): 3.0111332e-6 +RMSE (Root MSE): 0.0017352617 +MAE (mean ABS error): 0.0010863539 +maxAE (max ABS error) 0.007594957 +Lipschitz bound: 1.0 + +#======================# +#======================# +TEST STATS +R² score: 0.99997591 +MSE (mean SQR error): 3.0111332e-6 +RMSE (Root MSE): 0.0017352617 +MAE (mean ABS error): 0.0010863539 +maxAE (max ABS error) 0.007594957 +Lipschitz bound: 1.0 + +#======================# +CHECKPOINT 05 +Epoch [0 / 0] TRAIN LOSS: 2.5519988e-6 || TEST LOSS: 2.5519988e-6 +#======================# +TRAIN STATS +R² score: 0.99997958 +MSE (mean SQR error): 2.5519988e-6 +RMSE (Root MSE): 0.0015974977 +MAE (mean ABS error): 0.001085908 +maxAE (max ABS error) 0.0062906677 +Lipschitz bound: 1.0 + +#======================# +#======================# +TEST STATS +R² score: 0.99997958 +MSE (mean SQR error): 2.5519988e-6 +RMSE (Root MSE): 0.0015974977 +MAE (mean ABS error): 0.001085908 +maxAE (max ABS error) 0.0062906677 +Lipschitz bound: 1.0 + +#======================# diff --git a/experiments_NGN/Burg1D/dump_tanh/project3/plt1.png b/experiments_NGN/Burg1D/dump_tanh/project3/plt1.png new file mode 100644 index 00000000..b24500a8 Binary files /dev/null and b/experiments_NGN/Burg1D/dump_tanh/project3/plt1.png differ diff --git a/experiments_NGN/Burg1D/dump_tanh/project3/split0/plt_training.png b/experiments_NGN/Burg1D/dump_tanh/project3/split0/plt_training.png new file mode 100644 index 00000000..bec2a226 Binary files /dev/null and b/experiments_NGN/Burg1D/dump_tanh/project3/split0/plt_training.png differ diff --git a/experiments_NGN/Burg1D/dump_tanh/project3/split0/statistics.txt b/experiments_NGN/Burg1D/dump_tanh/project3/split0/statistics.txt new file mode 100644 index 00000000..1bf5552d --- /dev/null +++ b/experiments_NGN/Burg1D/dump_tanh/project3/split0/statistics.txt @@ -0,0 +1,110 @@ +CHECKPOINT 01 +Epoch [0 / 0] TRAIN LOSS: 0.0001687717 || TEST LOSS: 0.0001687717 +#======================# +TRAIN STATS +R² score: 0.99865018 +MSE (mean SQR error): 0.0001687717 +RMSE (Root MSE): 0.012991216 +MAE (mean ABS error): 0.010210422 +maxAE (max ABS error) 0.033723619 +Lipschitz bound: 1.0 + +#======================# +#======================# +TEST STATS +R² score: 0.99865018 +MSE (mean SQR error): 0.0001687717 +RMSE (Root MSE): 0.012991216 +MAE (mean ABS error): 0.010210422 +maxAE (max ABS error) 0.033723619 +Lipschitz bound: 1.0 + +#======================# +CHECKPOINT 02 +Epoch [0 / 0] TRAIN LOSS: 0.00016857703 || TEST LOSS: 0.00016857703 +#======================# +TRAIN STATS +R² score: 0.99864741 +MSE (mean SQR error): 0.00016857703 +RMSE (Root MSE): 0.012983722 +MAE (mean ABS error): 0.010329735 +maxAE (max ABS error) 0.033443771 +Lipschitz bound: 1.0 + +#======================# +#======================# +TEST STATS +R² score: 0.99864741 +MSE (mean SQR error): 0.00016857703 +RMSE (Root MSE): 0.012983722 +MAE (mean ABS error): 0.010329735 +maxAE (max ABS error) 0.033443771 +Lipschitz bound: 1.0 + +#======================# +CHECKPOINT 03 +Epoch [0 / 0] TRAIN LOSS: 0.00016835432 || TEST LOSS: 0.00016835432 +#======================# +TRAIN STATS +R² score: 0.99865006 +MSE (mean SQR error): 0.00016835432 +RMSE (Root MSE): 0.012975142 +MAE (mean ABS error): 0.010102824 +maxAE (max ABS error) 0.033824168 +Lipschitz bound: 1.0 + +#======================# +#======================# +TEST STATS +R² score: 0.99865006 +MSE (mean SQR error): 0.00016835432 +RMSE (Root MSE): 0.012975142 +MAE (mean ABS error): 0.010102824 +maxAE (max ABS error) 0.033824168 +Lipschitz bound: 1.0 + +#======================# +CHECKPOINT 04 +Epoch [0 / 0] TRAIN LOSS: 0.00016816362 || TEST LOSS: 0.00016816362 +#======================# +TRAIN STATS +R² score: 0.99865271 +MSE (mean SQR error): 0.00016816362 +RMSE (Root MSE): 0.012967791 +MAE (mean ABS error): 0.010256717 +maxAE (max ABS error) 0.033348769 +Lipschitz bound: 1.0 + +#======================# +#======================# +TEST STATS +R² score: 0.99865271 +MSE (mean SQR error): 0.00016816362 +RMSE (Root MSE): 0.012967791 +MAE (mean ABS error): 0.010256717 +maxAE (max ABS error) 0.033348769 +Lipschitz bound: 1.0 + +#======================# +CHECKPOINT 05 +Epoch [0 / 0] TRAIN LOSS: 0.00016815641 || TEST LOSS: 0.00016815641 +#======================# +TRAIN STATS +R² score: 0.99865294 +MSE (mean SQR error): 0.00016815641 +RMSE (Root MSE): 0.012967514 +MAE (mean ABS error): 0.010268473 +maxAE (max ABS error) 0.033390351 +Lipschitz bound: 1.0 + +#======================# +#======================# +TEST STATS +R² score: 0.99865294 +MSE (mean SQR error): 0.00016815641 +RMSE (Root MSE): 0.012967514 +MAE (mean ABS error): 0.010268473 +maxAE (max ABS error) 0.033390351 +Lipschitz bound: 1.0 + +#======================# diff --git a/experiments_NGN/Burg1D/dump_tanh/project3/split1/plt_training.png b/experiments_NGN/Burg1D/dump_tanh/project3/split1/plt_training.png new file mode 100644 index 00000000..f99a9fcd Binary files /dev/null and b/experiments_NGN/Burg1D/dump_tanh/project3/split1/plt_training.png differ diff --git a/experiments_NGN/Burg1D/dump_tanh/project3/split1/statistics.txt b/experiments_NGN/Burg1D/dump_tanh/project3/split1/statistics.txt new file mode 100644 index 00000000..3f7a936c --- /dev/null +++ b/experiments_NGN/Burg1D/dump_tanh/project3/split1/statistics.txt @@ -0,0 +1,110 @@ +CHECKPOINT 01 +Epoch [0 / 0] TRAIN LOSS: 2.3758495e-5 || TEST LOSS: 2.3758495e-5 +#======================# +TRAIN STATS +R² score: 0.9998099 +MSE (mean SQR error): 2.3758495e-5 +RMSE (Root MSE): 0.0048742686 +MAE (mean ABS error): 0.0035588103 +maxAE (max ABS error) 0.015732499 +Lipschitz bound: 1.0 + +#======================# +#======================# +TEST STATS +R² score: 0.9998099 +MSE (mean SQR error): 2.3758495e-5 +RMSE (Root MSE): 0.0048742686 +MAE (mean ABS error): 0.0035588103 +maxAE (max ABS error) 0.015732499 +Lipschitz bound: 1.0 + +#======================# +CHECKPOINT 02 +Epoch [0 / 0] TRAIN LOSS: 2.3636343e-5 || TEST LOSS: 2.3636343e-5 +#======================# +TRAIN STATS +R² score: 0.99981075 +MSE (mean SQR error): 2.3636343e-5 +RMSE (Root MSE): 0.0048617222 +MAE (mean ABS error): 0.0037358565 +maxAE (max ABS error) 0.015467631 +Lipschitz bound: 1.0 + +#======================# +#======================# +TEST STATS +R² score: 0.99981075 +MSE (mean SQR error): 2.3636343e-5 +RMSE (Root MSE): 0.0048617222 +MAE (mean ABS error): 0.0037358565 +maxAE (max ABS error) 0.015467631 +Lipschitz bound: 1.0 + +#======================# +CHECKPOINT 03 +Epoch [0 / 0] TRAIN LOSS: 2.3001714e-5 || TEST LOSS: 2.3001714e-5 +#======================# +TRAIN STATS +R² score: 0.99981586 +MSE (mean SQR error): 2.3001714e-5 +RMSE (Root MSE): 0.0047960102 +MAE (mean ABS error): 0.0035291108 +maxAE (max ABS error) 0.015888622 +Lipschitz bound: 1.0 + +#======================# +#======================# +TEST STATS +R² score: 0.99981586 +MSE (mean SQR error): 2.3001714e-5 +RMSE (Root MSE): 0.0047960102 +MAE (mean ABS error): 0.0035291108 +maxAE (max ABS error) 0.015888622 +Lipschitz bound: 1.0 + +#======================# +CHECKPOINT 04 +Epoch [0 / 0] TRAIN LOSS: 2.286497e-5 || TEST LOSS: 2.286497e-5 +#======================# +TRAIN STATS +R² score: 0.99981699 +MSE (mean SQR error): 2.286497e-5 +RMSE (Root MSE): 0.004781733 +MAE (mean ABS error): 0.0035102408 +maxAE (max ABS error) 0.015743481 +Lipschitz bound: 1.0 + +#======================# +#======================# +TEST STATS +R² score: 0.99981699 +MSE (mean SQR error): 2.286497e-5 +RMSE (Root MSE): 0.004781733 +MAE (mean ABS error): 0.0035102408 +maxAE (max ABS error) 0.015743481 +Lipschitz bound: 1.0 + +#======================# +CHECKPOINT 05 +Epoch [0 / 0] TRAIN LOSS: 2.284892e-5 || TEST LOSS: 2.284892e-5 +#======================# +TRAIN STATS +R² score: 0.99981718 +MSE (mean SQR error): 2.284892e-5 +RMSE (Root MSE): 0.0047800543 +MAE (mean ABS error): 0.0035198963 +maxAE (max ABS error) 0.01572267 +Lipschitz bound: 1.0 + +#======================# +#======================# +TEST STATS +R² score: 0.99981718 +MSE (mean SQR error): 2.284892e-5 +RMSE (Root MSE): 0.0047800543 +MAE (mean ABS error): 0.0035198963 +maxAE (max ABS error) 0.01572267 +Lipschitz bound: 1.0 + +#======================# diff --git a/experiments_NGN/Burg1D/dump_tanh/project3/split2/plt_training.png b/experiments_NGN/Burg1D/dump_tanh/project3/split2/plt_training.png new file mode 100644 index 00000000..544fecca Binary files /dev/null and b/experiments_NGN/Burg1D/dump_tanh/project3/split2/plt_training.png differ diff --git a/experiments_NGN/Burg1D/dump_tanh/project3/split2/statistics.txt b/experiments_NGN/Burg1D/dump_tanh/project3/split2/statistics.txt new file mode 100644 index 00000000..37e6b116 --- /dev/null +++ b/experiments_NGN/Burg1D/dump_tanh/project3/split2/statistics.txt @@ -0,0 +1,110 @@ +CHECKPOINT 01 +Epoch [0 / 0] TRAIN LOSS: 5.7194635e-6 || TEST LOSS: 5.7194635e-6 +#======================# +TRAIN STATS +R² score: 0.9999542 +MSE (mean SQR error): 5.7194635e-6 +RMSE (Root MSE): 0.00239154 +MAE (mean ABS error): 0.0013808964 +maxAE (max ABS error) 0.0093973484 +Lipschitz bound: 1.0 + +#======================# +#======================# +TEST STATS +R² score: 0.9999542 +MSE (mean SQR error): 5.7194635e-6 +RMSE (Root MSE): 0.00239154 +MAE (mean ABS error): 0.0013808964 +maxAE (max ABS error) 0.0093973484 +Lipschitz bound: 1.0 + +#======================# +CHECKPOINT 02 +Epoch [0 / 0] TRAIN LOSS: 3.5642064e-6 || TEST LOSS: 3.5642064e-6 +#======================# +TRAIN STATS +R² score: 0.99997149 +MSE (mean SQR error): 3.5642064e-6 +RMSE (Root MSE): 0.0018879106 +MAE (mean ABS error): 0.0013091088 +maxAE (max ABS error) 0.0076796236 +Lipschitz bound: 1.0 + +#======================# +#======================# +TEST STATS +R² score: 0.99997149 +MSE (mean SQR error): 3.5642064e-6 +RMSE (Root MSE): 0.0018879106 +MAE (mean ABS error): 0.0013091088 +maxAE (max ABS error) 0.0076796236 +Lipschitz bound: 1.0 + +#======================# +CHECKPOINT 03 +Epoch [0 / 0] TRAIN LOSS: 3.0578848e-6 || TEST LOSS: 3.0578848e-6 +#======================# +TRAIN STATS +R² score: 0.99997553 +MSE (mean SQR error): 3.0578848e-6 +RMSE (Root MSE): 0.0017486809 +MAE (mean ABS error): 0.0011869435 +maxAE (max ABS error) 0.0072761523 +Lipschitz bound: 1.0 + +#======================# +#======================# +TEST STATS +R² score: 0.99997553 +MSE (mean SQR error): 3.0578848e-6 +RMSE (Root MSE): 0.0017486809 +MAE (mean ABS error): 0.0011869435 +maxAE (max ABS error) 0.0072761523 +Lipschitz bound: 1.0 + +#======================# +CHECKPOINT 04 +Epoch [0 / 0] TRAIN LOSS: 2.9258117e-6 || TEST LOSS: 2.9258117e-6 +#======================# +TRAIN STATS +R² score: 0.99997658 +MSE (mean SQR error): 2.9258117e-6 +RMSE (Root MSE): 0.0017105004 +MAE (mean ABS error): 0.0011084494 +maxAE (max ABS error) 0.0073067117 +Lipschitz bound: 1.0 + +#======================# +#======================# +TEST STATS +R² score: 0.99997658 +MSE (mean SQR error): 2.9258117e-6 +RMSE (Root MSE): 0.0017105004 +MAE (mean ABS error): 0.0011084494 +maxAE (max ABS error) 0.0073067117 +Lipschitz bound: 1.0 + +#======================# +CHECKPOINT 05 +Epoch [0 / 0] TRAIN LOSS: 2.4464908e-6 || TEST LOSS: 2.4464908e-6 +#======================# +TRAIN STATS +R² score: 0.99998043 +MSE (mean SQR error): 2.4464908e-6 +RMSE (Root MSE): 0.0015641262 +MAE (mean ABS error): 0.0010587175 +maxAE (max ABS error) 0.0060922657 +Lipschitz bound: 1.0 + +#======================# +#======================# +TEST STATS +R² score: 0.99998043 +MSE (mean SQR error): 2.4464908e-6 +RMSE (Root MSE): 0.0015641262 +MAE (mean ABS error): 0.0010587175 +maxAE (max ABS error) 0.0060922657 +Lipschitz bound: 1.0 + +#======================# diff --git a/experiments_NGN/Burg1D/dump_rswaf_orig/evolve_e1_case1.png b/experiments_NGN/Burg1D/dump_tanh_orig/evolve_e1_case1.png similarity index 100% rename from experiments_NGN/Burg1D/dump_rswaf_orig/evolve_e1_case1.png rename to experiments_NGN/Burg1D/dump_tanh_orig/evolve_e1_case1.png diff --git a/experiments_NGN/Burg1D/dump_rswaf_orig/evolve_e1_case2.png b/experiments_NGN/Burg1D/dump_tanh_orig/evolve_e1_case2.png similarity index 100% rename from experiments_NGN/Burg1D/dump_rswaf_orig/evolve_e1_case2.png rename to experiments_NGN/Burg1D/dump_tanh_orig/evolve_e1_case2.png diff --git a/experiments_NGN/Burg1D/dump_rswaf_orig/evolve_e1_case3.png b/experiments_NGN/Burg1D/dump_tanh_orig/evolve_e1_case3.png similarity index 100% rename from experiments_NGN/Burg1D/dump_rswaf_orig/evolve_e1_case3.png rename to experiments_NGN/Burg1D/dump_tanh_orig/evolve_e1_case3.png diff --git a/experiments_NGN/Burg1D/dump_rswaf_orig/evolve_e1_case4.png b/experiments_NGN/Burg1D/dump_tanh_orig/evolve_e1_case4.png similarity index 100% rename from experiments_NGN/Burg1D/dump_rswaf_orig/evolve_e1_case4.png rename to experiments_NGN/Burg1D/dump_tanh_orig/evolve_e1_case4.png diff --git a/experiments_NGN/Burg1D/dump_rswaf_orig/evolve_e1_case5.png b/experiments_NGN/Burg1D/dump_tanh_orig/evolve_e1_case5.png similarity index 100% rename from experiments_NGN/Burg1D/dump_rswaf_orig/evolve_e1_case5.png rename to experiments_NGN/Burg1D/dump_tanh_orig/evolve_e1_case5.png diff --git a/experiments_NGN/Burg1D/dump_rswaf_orig/evolve_e1_case6.png b/experiments_NGN/Burg1D/dump_tanh_orig/evolve_e1_case6.png similarity index 100% rename from experiments_NGN/Burg1D/dump_rswaf_orig/evolve_e1_case6.png rename to experiments_NGN/Burg1D/dump_tanh_orig/evolve_e1_case6.png diff --git a/experiments_NGN/Burg1D/dump_rswaf_orig/evolve_u1_case1.png b/experiments_NGN/Burg1D/dump_tanh_orig/evolve_u1_case1.png similarity index 100% rename from experiments_NGN/Burg1D/dump_rswaf_orig/evolve_u1_case1.png rename to experiments_NGN/Burg1D/dump_tanh_orig/evolve_u1_case1.png diff --git a/experiments_NGN/Burg1D/dump_rswaf_orig/evolve_u1_case2.png b/experiments_NGN/Burg1D/dump_tanh_orig/evolve_u1_case2.png similarity index 100% rename from experiments_NGN/Burg1D/dump_rswaf_orig/evolve_u1_case2.png rename to experiments_NGN/Burg1D/dump_tanh_orig/evolve_u1_case2.png diff --git a/experiments_NGN/Burg1D/dump_rswaf_orig/evolve_u1_case3.png b/experiments_NGN/Burg1D/dump_tanh_orig/evolve_u1_case3.png similarity index 100% rename from experiments_NGN/Burg1D/dump_rswaf_orig/evolve_u1_case3.png rename to experiments_NGN/Burg1D/dump_tanh_orig/evolve_u1_case3.png diff --git a/experiments_NGN/Burg1D/dump_rswaf_orig/evolve_u1_case4.png b/experiments_NGN/Burg1D/dump_tanh_orig/evolve_u1_case4.png similarity index 100% rename from experiments_NGN/Burg1D/dump_rswaf_orig/evolve_u1_case4.png rename to experiments_NGN/Burg1D/dump_tanh_orig/evolve_u1_case4.png diff --git a/experiments_NGN/Burg1D/dump_rswaf_orig/evolve_u1_case5.png b/experiments_NGN/Burg1D/dump_tanh_orig/evolve_u1_case5.png similarity index 100% rename from experiments_NGN/Burg1D/dump_rswaf_orig/evolve_u1_case5.png rename to experiments_NGN/Burg1D/dump_tanh_orig/evolve_u1_case5.png diff --git a/experiments_NGN/Burg1D/dump_rswaf_orig/evolve_u1_case6.png b/experiments_NGN/Burg1D/dump_tanh_orig/evolve_u1_case6.png similarity index 100% rename from experiments_NGN/Burg1D/dump_rswaf_orig/evolve_u1_case6.png rename to experiments_NGN/Burg1D/dump_tanh_orig/evolve_u1_case6.png diff --git a/experiments_NGN/Burg1D/dump_rswaf_orig/project1/plt1.png b/experiments_NGN/Burg1D/dump_tanh_orig/project1/plt1.png similarity index 100% rename from experiments_NGN/Burg1D/dump_rswaf_orig/project1/plt1.png rename to experiments_NGN/Burg1D/dump_tanh_orig/project1/plt1.png diff --git a/experiments_NGN/Burg1D/dump_rswaf_orig/project1/plt_training.png b/experiments_NGN/Burg1D/dump_tanh_orig/project1/plt_training.png similarity index 100% rename from experiments_NGN/Burg1D/dump_rswaf_orig/project1/plt_training.png rename to experiments_NGN/Burg1D/dump_tanh_orig/project1/plt_training.png diff --git a/experiments_NGN/Burg1D/dump_rswaf_orig/project1/statistics.txt b/experiments_NGN/Burg1D/dump_tanh_orig/project1/statistics.txt similarity index 100% rename from experiments_NGN/Burg1D/dump_rswaf_orig/project1/statistics.txt rename to experiments_NGN/Burg1D/dump_tanh_orig/project1/statistics.txt diff --git a/experiments_NGN/Burg1D/dump_rswaf_orig/project2/plt1.png b/experiments_NGN/Burg1D/dump_tanh_orig/project2/plt1.png similarity index 100% rename from experiments_NGN/Burg1D/dump_rswaf_orig/project2/plt1.png rename to experiments_NGN/Burg1D/dump_tanh_orig/project2/plt1.png diff --git a/experiments_NGN/Burg1D/dump_rswaf_orig/project2/plt_training.png b/experiments_NGN/Burg1D/dump_tanh_orig/project2/plt_training.png similarity index 100% rename from experiments_NGN/Burg1D/dump_rswaf_orig/project2/plt_training.png rename to experiments_NGN/Burg1D/dump_tanh_orig/project2/plt_training.png diff --git a/experiments_NGN/Burg1D/dump_rswaf_orig/project2/statistics.txt b/experiments_NGN/Burg1D/dump_tanh_orig/project2/statistics.txt similarity index 100% rename from experiments_NGN/Burg1D/dump_rswaf_orig/project2/statistics.txt rename to experiments_NGN/Burg1D/dump_tanh_orig/project2/statistics.txt diff --git a/experiments_NGN/Burg1D/dump_rswaf_orig/project3/plt1.png b/experiments_NGN/Burg1D/dump_tanh_orig/project3/plt1.png similarity index 100% rename from experiments_NGN/Burg1D/dump_rswaf_orig/project3/plt1.png rename to experiments_NGN/Burg1D/dump_tanh_orig/project3/plt1.png diff --git a/experiments_NGN/Burg1D/dump_rswaf_orig/project3/plt_training.png b/experiments_NGN/Burg1D/dump_tanh_orig/project3/plt_training.png similarity index 100% rename from experiments_NGN/Burg1D/dump_rswaf_orig/project3/plt_training.png rename to experiments_NGN/Burg1D/dump_tanh_orig/project3/plt_training.png diff --git a/experiments_NGN/Burg1D/dump_rswaf_orig/project3/statistics.txt b/experiments_NGN/Burg1D/dump_tanh_orig/project3/statistics.txt similarity index 100% rename from experiments_NGN/Burg1D/dump_rswaf_orig/project3/statistics.txt rename to experiments_NGN/Burg1D/dump_tanh_orig/project3/statistics.txt diff --git a/experiments_NGN/Burg1D/dump_rswaf_orig/project4/plt1.png b/experiments_NGN/Burg1D/dump_tanh_orig/project4/plt1.png similarity index 100% rename from experiments_NGN/Burg1D/dump_rswaf_orig/project4/plt1.png rename to experiments_NGN/Burg1D/dump_tanh_orig/project4/plt1.png diff --git a/experiments_NGN/Burg1D/dump_rswaf_orig/project4/plt_training.png b/experiments_NGN/Burg1D/dump_tanh_orig/project4/plt_training.png similarity index 100% rename from experiments_NGN/Burg1D/dump_rswaf_orig/project4/plt_training.png rename to experiments_NGN/Burg1D/dump_tanh_orig/project4/plt_training.png diff --git a/experiments_NGN/Burg1D/dump_rswaf_orig/project4/statistics.txt b/experiments_NGN/Burg1D/dump_tanh_orig/project4/statistics.txt similarity index 100% rename from experiments_NGN/Burg1D/dump_rswaf_orig/project4/statistics.txt rename to experiments_NGN/Burg1D/dump_tanh_orig/project4/statistics.txt diff --git a/experiments_NGN/Burg1D/dump_rswaf_orig/project5/plt1.png b/experiments_NGN/Burg1D/dump_tanh_orig/project5/plt1.png similarity index 100% rename from experiments_NGN/Burg1D/dump_rswaf_orig/project5/plt1.png rename to experiments_NGN/Burg1D/dump_tanh_orig/project5/plt1.png diff --git a/experiments_NGN/Burg1D/dump_rswaf_orig/project5/plt_training.png b/experiments_NGN/Burg1D/dump_tanh_orig/project5/plt_training.png similarity index 100% rename from experiments_NGN/Burg1D/dump_rswaf_orig/project5/plt_training.png rename to experiments_NGN/Burg1D/dump_tanh_orig/project5/plt_training.png diff --git a/experiments_NGN/Burg1D/dump_rswaf_orig/project5/statistics.txt b/experiments_NGN/Burg1D/dump_tanh_orig/project5/statistics.txt similarity index 100% rename from experiments_NGN/Burg1D/dump_rswaf_orig/project5/statistics.txt rename to experiments_NGN/Burg1D/dump_tanh_orig/project5/statistics.txt diff --git a/experiments_NGN/Burg1D/dump_rswaf_orig/project6/plt1.png b/experiments_NGN/Burg1D/dump_tanh_orig/project6/plt1.png similarity index 100% rename from experiments_NGN/Burg1D/dump_rswaf_orig/project6/plt1.png rename to experiments_NGN/Burg1D/dump_tanh_orig/project6/plt1.png diff --git a/experiments_NGN/Burg1D/dump_rswaf_orig/project6/plt_training.png b/experiments_NGN/Burg1D/dump_tanh_orig/project6/plt_training.png similarity index 100% rename from experiments_NGN/Burg1D/dump_rswaf_orig/project6/plt_training.png rename to experiments_NGN/Burg1D/dump_tanh_orig/project6/plt_training.png diff --git a/experiments_NGN/Burg1D/dump_rswaf_orig/project6/statistics.txt b/experiments_NGN/Burg1D/dump_tanh_orig/project6/statistics.txt similarity index 100% rename from experiments_NGN/Burg1D/dump_rswaf_orig/project6/statistics.txt rename to experiments_NGN/Burg1D/dump_tanh_orig/project6/statistics.txt diff --git a/experiments_NGN/Burg1D/run.jl b/experiments_NGN/Burg1D/run.jl index b17f28b8..9f88adb4 100644 --- a/experiments_NGN/Burg1D/run.jl +++ b/experiments_NGN/Burg1D/run.jl @@ -30,7 +30,7 @@ data_kws = (; Ix = :, It = :) # data_kws = (; Ix = LinRange(1, 8192, 64), It = :) # data_kws = map(x -> round.(Int, x), data_kws) -# train_params = (; E = 100,) +# train_params = (; E = 100, Ng = 1, Nf = 1, train_freq = false) # evolve_params = (; scheme = :GalerkinCollocation) # # evolve_params = (; timealg = RungeKutta4(), Δt = 1e-4, adaptive = false) # # evolve_params = (; timealg = EulerForward(), Δt = 1e-4, adaptive = false) @@ -40,20 +40,31 @@ data_kws = (; Ix = :, It = :) # modeldir = joinpath(@__DIR__, "dump_gaussian") #------------------------------------------------------# -# RSWAF +# Tanh kernels #------------------------------------------------------# -# data_kws = (; Ix = LinRange(1, 512, 64), It = LinRange(1, 500, 500)) -# data_kws = map(x -> round.(Int, x), data_kws) +# # data_kws = (; Ix = LinRange(1, 512, 64), It = LinRange(1, 500, 500)) +# # data_kws = map(x -> round.(Int, x), data_kws) +# +# train_params = (; N = 1, Nsplits = 0) +# evolve_params = (; scheme = :GalerkinCollocation) +# # evolve_params = (; scheme = :GalerkinCollocation, timealg = Tsit5()) +# # evolve_params = (; timealg = EulerForward())#, Δt = 1e-3, adaptive = false) +# # evolve_params = (; timealg = RungeKutta4())#, Δt = 1e-3, adaptive = false) +# +# makemodel = makemodelTanh +# modelfilename = "model_05.jld2" +# modeldir = joinpath(@__DIR__, "dump_tanh_orig") -train_params = (; type = :RSWAF) +#------------------------------------------------------# +# Tanh kernels +#------------------------------------------------------# +train_params = (; N = 1, Nsplits = 2) evolve_params = (; scheme = :GalerkinCollocation) -# evolve_params = (; scheme = :GalerkinCollocation, timealg = Tsit5()) # evolve_params = (; timealg = EulerForward())#, Δt = 1e-3, adaptive = false) -# evolve_params = (; timealg = RungeKutta4())#, Δt = 1e-3, adaptive = false) -makemodel = makemodelGaussian -modelfilename = "model_05.jld2" -modeldir = joinpath(@__DIR__, "dump_rswaf") +makemodel = makemodelTanh +modelfilename = joinpath("split$(train_params.Nsplits)","model_05.jld2") +modeldir = joinpath(@__DIR__, "dump_tanh") #------------------------------------------------------# # Evolve @@ -63,8 +74,8 @@ modeldir = joinpath(@__DIR__, "dump_rswaf") XD = TD = UD = UP = PS = () NN, p, st = repeat([nothing], 3) -for case in 1:1 -# for case in 3:3 +# for case in 1:1 +for case in 2:3 # for case in 1:6 cc = mod1(case, 4) prob = BurgersViscous1D(1f-4) @@ -90,7 +101,7 @@ end # GAUSSIAN REFINEMENT/CULLING # - # -# RSWAF +# TANH KERNELS # - intead of/ along with a global shift, have a localized shift by forming # a plateau with tanh. # The plateau can degrade to 0, or produce sharper features diff --git a/experiments_NGN/ng_evolve.jl b/experiments_NGN/ng_evolve.jl index 5d8a8390..bc973ccc 100644 --- a/experiments_NGN/ng_evolve.jl +++ b/experiments_NGN/ng_evolve.jl @@ -194,7 +194,7 @@ function ngEvolve( scheme = if scheme ∈ (:GalerkinProjection, :LSPG) autodiff = AutoForwardDiff() - linsolve = QRFactorization() + linsolve = QRFactorization(ColumnNorm()) linesearch = LineSearch() nlssolve = GaussNewton(;autodiff, linsolve, linesearch) nlsmaxiters = 20 @@ -234,37 +234,14 @@ function ngEvolve( # evolve #==============# - if !isa(scheme, GalerkinCollocation) - args = (prob, device(model), timealg, scheme, (device(data[1:2])..., data[3]), device(p0 .|> T), Δt) - kwargs = (; adaptive, autodiff_xyz, ϵ_xyz, learn_ic, verbose, device,) - - if benchmark # assume CUDA - Logging.disable_logging(Logging.Warn) - timeROM = @belapsed CUDA.@sync $evolve_model($args...; $kwargs...) - end - - statsROM = if device isa LuxDeviceUtils.AbstractLuxGPUDevice - CUDA.@timed _, ps, _ = evolve_model(args...; kwargs...) - else - @timed _, ps, _ = evolve_model(args...; kwargs...) - end - - @set! statsROM.value = nothing - if benchmark - @set! statsROM.time = timeROM - end - - @show statsROM.time - else - + if isa(scheme, GalerkinCollocation) if !isa(timealg, SciMLBase.AbstractODEAlgorithm) # explicit: Euler(), RK4(), SSPRK43(), Tsit5() # implicit: ImplicitEuler(autodiff = false), Rosenbrock32(autodiff = false), Rodas5(autodiff = false) - # for (autodiff = true), use PreallocationTools.dual_cache ? - timealg = Tsit5() - # timealg = Rodas5(autodiff = false) + # timealg = Tsit5() + timealg = Rodas5(autodiff = false) end dt = 1f-4 @@ -322,6 +299,29 @@ function ngEvolve( @assert SciMLBase.successful_retcode(sol) ps = Array(sol) + else + # LSPG, GalerkinProjection + + args = (prob, device(model), timealg, scheme, (device(data[1:2])..., data[3]), device(p0 .|> T), Δt) + kwargs = (; adaptive, autodiff_xyz, ϵ_xyz, learn_ic, verbose, device,) + + if benchmark # assume CUDA + Logging.disable_logging(Logging.Warn) + timeROM = @belapsed CUDA.@sync $evolve_model($args...; $kwargs...) + end + + statsROM = if device isa LuxDeviceUtils.AbstractLuxGPUDevice + CUDA.@timed _, ps, _ = evolve_model(args...; kwargs...) + else + @timed _, ps, _ = evolve_model(args...; kwargs...) + end + + @set! statsROM.value = nothing + if benchmark + @set! statsROM.time = timeROM + end + + @show statsROM.time end #==============# diff --git a/experiments_NGN/ng_models.jl b/experiments_NGN/ng_models.jl index 9341a49a..1ad16fe3 100644 --- a/experiments_NGN/ng_models.jl +++ b/experiments_NGN/ng_models.jl @@ -1,6 +1,88 @@ # #======================================================# -# Gaussian +# Tanh kernels +#======================================================# +function makemodelTanh( + data::NTuple{2,Any}, + train_params::NamedTuple, + periods, + metadata::NamedTuple, + modeldir::String; + rng::Random.AbstractRNG = Random.default_rng(), + verbose::Bool = true, + device = Lux.gpu_device() +) + in_dim = size(data[1], 1) + out_dim = size(data[2], 1) + + #--------------------------------------------# + # get train params + #--------------------------------------------# + + periodic = true + + N = haskey(train_params, :N) ? train_params.N : 1 + E = haskey(train_params, :E) ? train_params.E : 200 + T = haskey(train_params, :T) ? train_params.T : Float32 + + Nsplits = haskey(train_params, :Nsplits) ? train_params.Nsplits : 0 + + warmup = haskey(train_params, :warmup) ? train_params.warmup : false + hessopt = haskey(train_params, :hessopt) ? train_params.hessopt : true + + #--------------------------------------------# + # architecture + #--------------------------------------------# + + i = in_dim + o = out_dim + decoder = TanhKernel1D(i, o, N) + + NN = decoder + #-------------------------------------------# + + lossfun = mse + batchsize_ = numobs(data) + opts, nepochs, schedules, early_stoppings, _batchsize = make_optimizer_gaussian(E, numobs(data), warmup, hessopt) + + #-------------------------------------------# + train_args = (; E, _batchsize, batchsize_) + metadata = (; metadata..., train_args) + + #-------------------------------------------# + p, st = Lux.setup(rng, NN) + p = ComponentArray(p) .|> T + ST = nothing + #-------------------------------------------# + + for isplit in 0:Nsplits + display(NN) + dir = if iszero(Nsplits) + modeldir + else + joinpath(modeldir, "split$(isplit)") + end + + @time (NN, p, st), ST = train_model( + NN, data; rng, p, st, _batchsize, batchsize_, + opts, nepochs, schedules, early_stoppings, + device, dir, metadata, lossfun, + ) + + @show p + @show length(p) + plot_training!(ST...) |> display + + if isplit != Nsplits + NN, p, st = split_TanhKernel1D(NN, p, st) + end + end + + (NN, p, st), ST, metadata +end + +#======================================================# +# Gaussian kernels #======================================================# function makemodelGaussian( data::NTuple{2,Any}, @@ -22,9 +104,6 @@ function makemodelGaussian( periodic = true - type = haskey(train_params, :type) ? train_params.type : :Gaussian - - # Gaussian Ng = haskey(train_params, :Ng) ? train_params.N : 4 # num_gauss Nf = haskey(train_params, :Nf) ? train_params.f : 4 # num_freqs σmin = haskey(train_params, :σmin) ? train_params.σmin : 1e-4 @@ -32,13 +111,8 @@ function makemodelGaussian( σinvert = haskey(train_params, :σinvert) ? train_params.σinvert : false train_freq = haskey(train_params, :train_freq) ? train_params.train_freq : true - # RSWAF - N = haskey(train_params, :N) ? train_params.N : 1 - T = haskey(train_params, :T) ? train_params.T : Float32 - E = haskey(train_params, :E) ? train_params.E : 200 exactIC = haskey(train_params, :exactIC) ? train_params.exactIC : (;) - warmup = haskey(train_params, :warmup) ? train_params.warmup : false hessopt = haskey(train_params, :hessopt) ? train_params.hessopt : true @@ -49,13 +123,7 @@ function makemodelGaussian( i = in_dim o = out_dim - decoder = if type === :RSWAF - N = 1 - N = 4 - - RSWAF1D(i, o, N; periodic) - - elseif type === :Gaussian + decoder = begin # # AD1D case 1-4 # Ng = Nf = 1 # σmin = 1e-2 @@ -97,8 +165,6 @@ function makemodelGaussian( # σinvert = true Gaussian1D(i, o, Ng, Nf; periodic, σmin, σsplit, σinvert, train_freq) - else - @error "Unsupported type. Choose `:type = :Gaussian`, or `:RSWAF`" end NN = Chain(; decoder) @@ -153,50 +219,41 @@ function makemodelGaussian( opts, nepochs, schedules, early_stoppings, device, dir, metadata, lossfun, ) + plot_training!(ST...) |> display - if type === :RSWAF - @show model[2].decoder.x̄ - @show model[2].decoder.w - @show model[2].decoder.b - @show model[2].decoder.c - @show model[2].decoder.ω0 - @show model[2].decoder.ω1 - elseif type === :Gaussian - - @show model[2].decoder.b - @show model[2].decoder.c - @show model[2].decoder.x̄ - - if σinvert - if σsplit - @show model[2].decoder.w - @show model[2].decoder.σil - @show model[2].decoder.σir - else - @show model[2].decoder.σi - end + @show model[2].decoder.b + @show model[2].decoder.c + @show model[2].decoder.x̄ + + if σinvert + if σsplit + @show model[2].decoder.w + @show model[2].decoder.σil + @show model[2].decoder.σir else - if σsplit - @show model[2].decoder.w - @show model[2].decoder.σl - @show model[2].decoder.σr - else - @show model[2].decoder.σ - end + @show model[2].decoder.σi end - - if train_freq - @show model[2].decoder.ω - @show model[2].decoder.ϕ + else + if σsplit + @show model[2].decoder.w + @show model[2].decoder.σl + @show model[2].decoder.σr else - # @show model[3].decoder.ω - # @show model[3].decoder.ϕ + @show model[2].decoder.σ end end + if train_freq + @show model[2].decoder.ω + @show model[2].decoder.ϕ + else + # @show model[3].decoder.ω + # @show model[3].decoder.ϕ + end + @show length(model[2]) - + model, ST, metadata end @@ -207,6 +264,7 @@ end #======================================================# # MFN (Multiplicative Filter Networks) #======================================================# + function makemodelMFN( data, train_params, @@ -419,8 +477,7 @@ function make_optimizer_gaussian( # _batchsize = (1, 1, 1, 1) lrs = (1f-3, 1f-3, 1f-3, 1f-3) - # lrs = (1f-2, 1f-2, 1f-2, 1f-2) - _batchsize = (1, 8, 64, 512) + _batchsize = (1, 4, 16, 64) N = length(lrs) opts = Tuple(Optimisers.Adam(lr) for lr in lrs) diff --git a/experiments_NGN/rswaf.jl b/experiments_NGN/rswaf.jl index feee295f..ef744ca6 100644 --- a/experiments_NGN/rswaf.jl +++ b/experiments_NGN/rswaf.jl @@ -7,43 +7,81 @@ joinpath(pkgdir(NeuralROMs), "experiments_NGN", "ng_models.jl") |> include #======================================================# -function gabor(x, α, x̄, σ, ω, ϕ,) - z = @. (x - x̄) / abs(σ) - gaussian = @. exp(-0.5 * z^2) - sinusodal = @. cos(2 * pi * ω * z + ϕ) - - α * gaussian .* sinusodal -end - function scaled_tanh(x, a, b, ω, x̄) - u = tanh(ω * (x - x̄)) # [-1, 1] + u = tanh_fast(ω * (x - x̄)) # [-1, 1] scale = (b - a) / 2 shift = (b + a) / 2 scale * u + shift end -function squarewave(x, x0, x1, ω0, ω1) - # a = x̄ - w - # b = x̄ + w - - u1 = @. scaled_tanh(x, -0.5, 0.5, ω0, x0) - u2 = @. -scaled_tanh(x, -0.5, 0.5, ω1, x1) - u1 + u2 -end - function rswaf(x, x̄, w, ω0, ω1, α) x0 = x̄ - w x1 = x̄ + w - u1 = @. tanh(ω0 * (x - x0)) - u2 = @. tanh(ω1 * (x - x1)) + u1 = @. tanh_fast(ω0 * (x - x0)) + u2 = @. tanh_fast(ω1 * (x - x1)) 0.5 * (u1 - u2) * α end + +#======================================================# +# Splitting Kernels in two +#======================================================# +x = LinRange(-1, 1, 1024) + +plts = () + +for (w, ω1, ω2) in ( + (0.5, 10, 50), + (0.5, 2, 50), + (0.1, 2, 50), + (0.1, 10, 10), +) + local c = 1.0 + local x0 = 0.0 + local ω = min(ω1, ω2) + + local y1 = rswaf(x, x0, w, ω1, ω2, c) + local y2 = rswaf(x, x0-w/2, w/2, ω1, ω, c) # left + local y3 = rswaf(x, x0+w/2, w/2, ω, ω2, c) # right + local y4 = y2 + y3 + + local plt = plot(; legend = false) + plot!(plt, x, y1, w = 4, c = :black) + plot!(plt, x, y2, w = 2, c = :red) + plot!(plt, x, y3, w = 2, c = :red) + plot!(plt, x, y4, w = 2, c = :magenta) + + @show sum(abs2, y1 - y4) + + global plts = (plts..., plt) +end + +p = plot(plts...) +display(p) + +#======================================================# +# Expressivity of Tanh kernels +#======================================================# +# x = LinRange(-1, 1, 1024) +# y1 = rswaf(x, -0.5, 0.3, 20, 20, 1.0) +# y2 = rswaf(x, 0, 0.1, 20, 30, 0.8) +# y3 = rswaf(x, 0.8, 0.1, 50, 50, 1.0) +# y4 = rswaf(x, 0, 0.5, 1.8, 50, 0.5) +# +# plt = plot(; legend = false) +# plot!(plt, x, y1, w = 4) +# plot!(plt, x, y2, w = 4) +# plot!(plt, x, y3, w = 4) +# plot!(plt, x, y4, w = 4) +# display(plt) + +#======================================================# +# Expanse of Tanh kernels #======================================================# # x = LinRange(-1, 1, 1024) # ω = [5 10 20 50] # LinRange(0, 50, N)' -# y = tanh.(x * ω) +# y = tanh_fast.(x * ω) # # plt = plot() # cs = [:red, :green, :blue, :black, :brown, :cyan, :magenta] @@ -53,57 +91,9 @@ end # # c = cs[i] # plot!(plt, x, y[:, i]; w = 2, label = "ω = $w", c) -# scatter!(plt, [-s, s], [0,0]; w = 2, label = nothing, markersize = 4, c) +# vline!(plt, [-s, s]; w = 1, s = :dash, c, label = nothing) # end # display(plt) -#======================================================# -x = LinRange(-1, 1, 1024) -y1 = rswaf(x, -0.5, 0.3, 20, 20, 1.0) -y2 = rswaf(x, 0, 0.1, 20, 30, 0.8) -y3 = rswaf(x, 0.8, 0.1, 50, 50, 1.0) -y4 = rswaf(x, 0, 0.5, 1.8, 50, 0.5) -# y5 = rswaf(x, 0, 0.5, 20, 20, 0.8) -# y6 = rswaf(x, 0, 0.5, 20, 20, 0.8) - -# x = LinRange(-3, 3, 1024) -# y1 = rswaf(sinpi.(x/2), 0, 0.5, 40, 5, 0.8) - -plt = plot(; legend = false) -plot!(plt, x, y1, w = 4) -plot!(plt, x, y2, w = 4) -plot!(plt, x, y3, w = 4) -plot!(plt, x, y4, w = 4) -# plot!(plt, x, y5, w = 4) -# plot!(plt, x, y6, w = 4) -display(plt) -#======================================================# - -# function plot_multigabor(x, Ng, Nf, σfactor) -# x0, x1 = extrema(x) -# span = (x1-x0) / Ng -# -# x̄ = LinRange(-1 + span/2, 1-span/2, Ng) -# -# plt = plot() -# gs = zeros(length(x), Nf, Ng) -# -# for j in 1:Ng -# for i in 1:Nf -# α = 1 / Nf -# # α = 2 * rand() - 1 -# ω = (i - 1) -# ϕ = 0 -# gs[:, i, j] = gabor(x, α, x̄[j], span / σfactor, ω, ϕ) -# plot!(plt, x, gs[:, i, j], c = :black, w = 2) -# end -# end -# -# plot!(plt, x, sum(gs, dims = 2:3) |> vec; -# c = :red, w = 2, ylims = (-1,1), legend = false -# ) -# plt -# end - #======================================================# nothing diff --git a/src/NeuralROMs.jl b/src/NeuralROMs.jl index d9756b04..4f59c614 100644 --- a/src/NeuralROMs.jl +++ b/src/NeuralROMs.jl @@ -49,7 +49,7 @@ using Tullio # data management using ComponentArrays -using Setfield: @set! +using Setfield: @set, @set! using UnPack using ConcreteStructs using IterTools diff --git a/src/dynamics/ordinarydiffeq.jl b/src/dynamics/ordinarydiffeq.jl index 0f83e81f..37bd7051 100644 --- a/src/dynamics/ordinarydiffeq.jl +++ b/src/dynamics/ordinarydiffeq.jl @@ -86,9 +86,10 @@ end ################## # in place ODE problem # pointless unless we're reusuing lincache +# and computing J, f in-place ################## -# function (l::GalerkinCollocation{false})( +# function (l::GalerkinCollocation{false, false})( # dp::AbstractVector, # p::AbstractVector, # params, diff --git a/src/dynamics/timeintegrator.jl b/src/dynamics/timeintegrator.jl index 6b593c66..f9dc16ac 100644 --- a/src/dynamics/timeintegrator.jl +++ b/src/dynamics/timeintegrator.jl @@ -390,7 +390,7 @@ function learn_p0( if isnothing(nlssolve) linesearch = LineSearch() autodiff = AutoForwardDiff() - linsolve = QRFactorization() + linsolve = QRFactorization(ColumnNorm()) nlssolve = GaussNewton(; autodiff, linsolve, linesearch) end diff --git a/src/layers/experimental.jl b/src/layers/experimental.jl index e2e2ce92..09af4c29 100644 --- a/src/layers/experimental.jl +++ b/src/layers/experimental.jl @@ -251,7 +251,7 @@ function (l::Gaussian1D)(x::AbstractMatrix{T}, ps, st::NamedTuple) where{T} end function scaled_tanh(x, a, b, w, x̄) - u = @. tanh(w * (x - x̄)) # [-1, 1] + u = @. tanh_fast(w * (x - x̄)) # [-1, 1] scale = @. (b - a) / 2 shift = @. (b + a) / 2 @. scale * u + shift @@ -267,91 +267,88 @@ end # end # #======================================================# -# 1D RSWAF Layer +# 1D Tanh kernel layer #======================================================# -export RSWAF1D +# Q. parameterize x̄, w or x0, x1 directly? +# - x̄ , w: compact support, orientation fixed +# - x0, x1: orientation switches if x0 < x1. Why is that a problem? +# potentially gives more flexibility with gradient descent ?? +# +# Q. Adding Tanh kernel with x1=x0 (resultant zero func) and fitting +# with GD as a form of mesh refinement. +# Test this idea out with initializing w as [1, 0, ..., 0] +# and seeing if the last zeros change. +# How does it compare with setting c = [1, 0, ..., 0] +# +# Q. We can also switch between the two during training/ online solve +# +# - parameterize x0, x1 and force them to be in [-1, 1] +# - try gradient boosting type approach -@concrete struct RSWAF1D{I<:Integer} <: Lux.AbstractExplicitLayer +export TanhKernel1D + +@concrete struct TanhKernel1D{I<:Integer} <: Lux.AbstractExplicitLayer in_dim::I out_dim::I - num_plateaus::I + num_kernels::I domain - split::Bool periodic::Bool T end -function RSWAF1D( +function TanhKernel1D( in_dim::Integer, out_dim::Integer, - num_plateaus::Integer; # number of plateaus + num_kernels::Integer; T = Float32, domain = [-1, 1], - split::Bool = false, periodic::Bool = false, ) @assert length(domain) == 2 @assert in_dim == out_dim == 1 - RSWAF1D(in_dim, out_dim, num_plateaus, T.(domain), split, periodic, T) + TanhKernel1D(in_dim, out_dim, num_kernels, T.(domain), periodic, T) end -function Base.show(io::IO, l::RSWAF1D) - println(io, "RSWAF1D($(l.in_dim), $(l.out_dim), $(l.num_plateaus))") +function Base.show(io::IO, l::TanhKernel1D) + println(io, "TanhKernel1D($(l.in_dim), $(l.out_dim), $(l.num_kernels))") end -function Lux.initialstates(rng::Random.AbstractRNG, l::RSWAF1D) +function Lux.initialstates(rng::Random.AbstractRNG, l::TanhKernel1D) (; half = l.T[0.5], - xdom0 = l.T[l.domain[1]], - xdom1 = l.T[l.domain[2]], + # xdom0 = l.T[l.domain[1]], + # xdom1 = l.T[l.domain[2]], # xmean = l.T[0.5 * (l.domain[1] + l.domain[2])], # xspan = l.T[l.domain[2] - l.domain[1]], ) end -# Q. parameterize x̄, w or x0, x1 directly? -# - x̄ , w: compact support, orientation fixed -# - x0, x1: orientation switches if x0 < x1. Why is that a problem? -# potentially gives more flexibility with gradient descent ?? -# -# Q. Adding RSWAF with x1=x0 (resultant zero func) and fitting -# with GD as a form of mesh refinement. -# Test this idea out with initializing w as [1, 0, ..., 0] -# and seeing if the last zeros change. -# How does it compare with setting c = [1, 0, ..., 0] -# -# Q. We can also switch between the two during training/ online solve -# -# - parameterize x0, x1 and force them to be in [-1, 1] -# - try gradient boosting type approach - -function Lux.initialparameters(rng::Random.AbstractRNG, l::RSWAF1D) - - x0, x1 = l.domain - xspan = (x1 - x0) / l.num_plateaus +function Lux.initialparameters(rng::Random.AbstractRNG, l::TanhKernel1D) - # # principled - # x̄ = LinRange(x0 + xspan / 2, x1 - xspan / 2, l.num_plateaus) .|> l.T - # w = zeros(l.num_plateaus) .|> l.T - # c = rand32(rng, l.num_plateaus) .* 2 .- 1 .|> l.T - # w[l.num_plateaus ÷ 2] = 1 + # # principled initialization + # x0, x1 = l.domain + # xspan = (x1 - x0) / l.num_kernels + # x̄ = LinRange(x0 + xspan / 2, x1 - xspan / 2, l.num_kernels) .|> l.T + # w = zeros(l.num_kernels) .|> l.T + # c = rand32(rng, l.num_kernels) .* 2 .- 1 .|> l.T + # w[l.num_kernels ÷ 2] = 1 # [1, 0, ..., 0] - x̄ = zeros(l.T, l.num_plateaus) - w = ones( l.T, l.num_plateaus) - c = fill(l.T(1), l.num_plateaus) + x̄ = zeros(l.T, l.num_kernels) + w = ones( l.T, l.num_kernels) + c = fill(l.T(1), l.num_kernels) w[2:end] .= 0 - x̄[2:end] .+= randn(rng, l.num_plateaus-1) * 10^(-2) + x̄[2:end] .+= randn(rng, l.num_kernels - 1) * 10^(-2) #------------------------------# # steepness - ω0 = fill(l.T(10), l.num_plateaus) - ω1 = fill(l.T(10), l.num_plateaus) + ω0 = fill(l.T(10), l.num_kernels) + ω1 = fill(l.T(10), l.num_kernels) # global shift b = zeros(l.T, 1) @@ -359,31 +356,78 @@ function Lux.initialparameters(rng::Random.AbstractRNG, l::RSWAF1D) (; x̄, w, ω0, ω1, b, c) end -function (l::RSWAF1D)(x::AbstractMatrix{T}, ps, st::NamedTuple) where{T} +function (l::TanhKernel1D)(x::AbstractMatrix{T}, ps, st::NamedTuple) where{T} x0 = @. ps.x̄ - ps.w x1 = @. ps.x̄ + ps.w - # ext0 = x0 - 3 ./ ps.ω0 - # ext1 = x1 + 3 ./ ps.ω1 - # - # if any(<(l.domain[1]), ext0) | any(>(l.domain[2]), ext1) - # @show ext0 - # @show ext1 + # if l.periodic # end - if l.periodic - end - - # make plateaus - y0 = @. tanh(ps.ω0 * (x - x0)) - y1 = @. tanh(ps.ω1 * (x - x1)) - y = @. st.half * (y0 - y1) * ps.c + # make kernels + y0 = @. tanh_fast(ps.ω0 * (x - x0)) + y1 = @. tanh_fast(ps.ω1 * (x - x1)) + y = @. (y0 - y1) * ps.c * st.half # (move to below) + # sum kernels y = sum(y; dims = 1) + + # add global shift y = @. y + ps.b y, st end +export split_TanhKernel1D + +function split_TanhKernel1D( + NN::TanhKernel1D, + p, + st::NamedTuple; + rng::AbstractRNG = Random.default_rng(), + # debug::Bool = false, +) + # Kernels + # [1, 2, 3] -> [_1, _2, _3, 1_, 2_, 3_] + + Nk = NN.num_kernels + NN_ = @set NN.num_kernels = 2 * Nk + p_, st_ = Lux.setup(copy(rng), NN_) + + halfw = p.w ./ 2 + ω_min = min.(p.ω0, p.ω1) + + p_.x̄[begin:Nk] .= p.x̄ - halfw + p_.x̄[Nk+1:end] .= p.x̄ + halfw + + p_.w[begin:Nk] .= halfw + p_.w[Nk+1:end] .= halfw + + p_.ω0[begin:Nk] .= p.ω0 + p_.ω0[Nk+1:end] .= ω_min + + p_.ω1[begin:Nk] .= ω_min + p_.ω1[Nk+1:end] .= p.ω1 + + p_.b .= p.b + + p_.c[begin:Nk] .= p.c + p_.c[Nk+1:end] .= p.c + + # if debug + # N = 1000 + # x = LinRange(NN.domain..., N) + # x = reshape(x, 1, N) .|> NN.T + # + # u = NN(x, p, st)[1] + # u_ = NN_(x, p_, st_)[1] + # + # e = sum(abs2, u - u_) / length(N) + # + # @assert e < eps(NN.T) "Got error $e" + # end + + NN_, p_, st_ +end + #======================================================# # diff --git a/src/utils.jl b/src/utils.jl index 3052a385..4ee74fa9 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -195,8 +195,8 @@ function check_linsol_retcode( # TODO: compute the spread of r1 - r1 = sum(abs2, r1) - r2 = sum(abs2, r2) + r1 = sum(abs2, r1) / length(r1) + r2 = sum(abs2, r2) / length(r2) println("Residuals: \t $(r1) \t $(r2)") end