-
Notifications
You must be signed in to change notification settings - Fork 6
Optim algorithms like BFGS, multi-LSTM hybrids, yaml with bounds and PBM, regularization - L2, per parameter optimisers #267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e3439f4
4af107b
714d6ea
0495dd1
a777da7
15ed575
4feb1cd
3594793
bdb8e54
19142cf
b2daf95
40690f9
a407bd5
50fcc92
aafa490
0c1b1c6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,7 +20,7 @@ function save_final!(paths::TrainingPaths, model, ps, st, x_train, forcings_trai | |
| if cfg.save_training | ||
| target_names = model.targets | ||
| save_epoch = stopper.best_epoch == 0 ? 0 : stopper.best_epoch | ||
| save_ps_st!(paths.best_model, model, cfg.cdev(ps), cfg.cdev(st), cfg.tracked_params, save_epoch) | ||
| save_ps_st(paths.best_model, model, cfg.cdev(ps), cfg.cdev(st), cfg.tracked_params, save_epoch) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it should be |
||
|
|
||
| ŷ_train, αst_train = model((cfg.cdev(x_train), cfg.cdev(forcings_train)), cfg.cdev(ps), LuxCore.testmode(cfg.cdev(st))) | ||
| ŷ_val, αst_val = model((cfg.cdev(x_val), cfg.cdev(forcings_val)), cfg.cdev(ps), LuxCore.testmode(cfg.cdev(st))) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| export get_all_groups | ||
| export load_group | ||
| function save_ps_st(file_name, hm, ps, st, save_ps) | ||
| function save_ps_st(file_name, hm, ps, st, save_ps, epoch = 0) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh, I see. Same function in both places, no need for the |
||
| hm_name = string(nameof(typeof(hm))) | ||
| # split physical parameters | ||
| tmp_e = if !isempty(save_ps) | ||
|
|
@@ -10,9 +10,9 @@ function save_ps_st(file_name, hm, ps, st, save_ps) | |
|
|
||
| isfile(file_name) && rm(file_name) | ||
| return jldopen(file_name, "w") do file | ||
| file["HybridModel_$hm_name/epoch_0"] = (ps, st) | ||
| file["HybridModel_$hm_name/epoch_$epoch"] = (ps, st) | ||
| if !isempty(save_ps) | ||
| file["physical_params/epoch_0"] = tmp_e | ||
| file["physical_params/epoch_$epoch"] = tmp_e | ||
| end | ||
| end | ||
| end | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When
Meta.parseis called withraise = false, parsing errors do not throw an exception. Instead, it returns an expression containing the error (e.g.,Expr(:error, ...)orExpr(:incomplete, ...)). Checking ifexpr_and_next === nothingis insufficient to catch these parsing failures, which can lead to invalid source code being written to the YAML. We should explicitly check if the parsed expression is an error or incomplete.