-
Notifications
You must be signed in to change notification settings - Fork 6
setup yaml #231
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
setup yaml #231
Changes from 1 commit
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 |
|---|---|---|
|
|
@@ -23,6 +23,7 @@ MLUtils = "f1d291b0-491e-4a28-83b9-f70985020b54" | |
| NCDatasets = "85f8d34a-cbdd-5861-8df4-14fed0d494ab" | ||
| NamedDims = "356022a1-0364-5f58-8944-0da4b18d706f" | ||
| OptimizationOptimisers = "42dfb2eb-d2b4-4451-abcd-913932933ac1" | ||
| OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" | ||
| PrettyTables = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d" | ||
| Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7" | ||
| ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca" | ||
|
|
@@ -31,6 +32,7 @@ Reexport = "189a3867-3050-52da-a836-e630ba90ab69" | |
| Static = "aedffcd0-7271-4cad-89d0-dc628f76c6d3" | ||
| Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" | ||
| StyledStrings = "f489334b-da3d-4c2e-b8f0-e476e12c162b" | ||
| YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6" | ||
|
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. |
||
| Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" | ||
|
|
||
| [weakdeps] | ||
|
|
@@ -60,12 +62,14 @@ Makie = "0.22, 0.23, 0.24" | |
| NCDatasets = "0.14.8" | ||
| NamedDims = "1.2.3" | ||
| OptimizationOptimisers = "0.3.7" | ||
| OrderedCollections = "1.8.1" | ||
|
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. |
||
| PrettyTables = "2.4.0, 3.1.2" | ||
| ProgressMeter = "1.10.4" | ||
| Reexport = "1.2.2" | ||
| Static = "1.3.1" | ||
| Statistics = "1" | ||
| StyledStrings = "1.0.3, 1.11.0" | ||
| YAML = "0.4.16" | ||
|
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. |
||
| Zygote = "0.7.7" | ||
| julia = "1.10" | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,7 @@ struct TrainResults | |
| st | ||
| best_epoch | ||
| best_loss | ||
| train_args | ||
|
||
| end | ||
|
|
||
| """ | ||
|
|
@@ -366,7 +367,8 @@ function train( | |
| ps, | ||
| st, | ||
| best_epoch, | ||
| best_agg_loss | ||
| best_agg_loss, | ||
| (; nepochs, batchsize, opt, patience, autodiff_backend, return_gradients, array_type, training_loss, loss_types, extra_loss, agg, train_from, random_seed, file_name, hybrid_name, return_model, monitor_names, folder_to_save, plotting, show_progress, yscale) | ||
|
||
| ) | ||
| end | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| export load_hybrid_config, save_hybrid_config | ||
| function load_hybrid_config(path::String; dicttype=OrderedDict{String,Any}) | ||
| return load_file(path; dicttype, ) | ||
| end | ||
|
|
||
| function save_hybrid_config(config::Dict, path::String) | ||
| return write_file(path, config) | ||
| end | ||
|
|
||
| function get_hybrid_config(hm::HybridModel) | ||
| hm_config = Dict{String,Any}() | ||
| for field in fieldnames(typeof(hm)) | ||
| hm_config[string(field)] = getfield(hm, field) | ||
| end | ||
| return hm_config | ||
| end | ||
|
||
|
|
||
| function get_train_config(train_args::TrainResults) | ||
| train_config = Dict{String,Any}() | ||
| for field in fieldnames(typeof(train_args)) | ||
| train_config[string(field)] = getfield(train_args, field) | ||
| end | ||
| return train_config | ||
| 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.
The
OrderedCollectionsdependency has been added. Please ensure that this package is necessary for the YAML functionality and that its inclusion does not introduce any unnecessary overhead or conflicts with existing dependencies.