-
Notifications
You must be signed in to change notification settings - Fork 100
refactor: load eq_param_index of BundleSolvers correctly #212
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
base: master
Are you sure you want to change the base?
Changes from all commits
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 |
|---|---|---|
|
|
@@ -530,7 +530,9 @@ def load(cls, | |
| t_min=t_min, | ||
| t_max=t_max, | ||
| theta_min=tuple(load_dict['solver'].r_min[1:]), | ||
| theta_max=tuple(load_dict['solver'].r_max[1:])) | ||
| theta_max=tuple(load_dict['solver'].r_max[1:]), | ||
| eq_param_index=load_dict['solver'].eq_param_index | ||
|
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. At a certain point we should consider refactoring the solver_utils package. A lot of the code seems to be a little ad-hoc. They are fine for now.
Collaborator
Author
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. Yes, I think we are due to think about refactoring and redesigning these pieces as they are pretty hard coded. I also have some thoughts on how parameters are saved - https://github.com/NeuroDiffGym/neurodiffeq/blob/master/neurodiffeq/solvers_utils.py#L99 which ties back to how parameters are used inside the function of the differential equation. I will open up an issue on this and we can discuss these things in detail. |
||
| ) | ||
|
|
||
| if best_nets != None: | ||
| solver.best_nets = best_nets | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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.
Is there a particular reason we want to use
self.eq_param_indexinstead ofeq_param_indexhere? Both ways should have the same effect most of the time, but I don't wantself.diff_eqsto be a closure that depends onself. This would make certain operations complicated, such as recreating a solverIf
eq_param_index1andeq_param_index2are different, the above won't work, assolver1.diff_eqswill always depend onsolver1.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.
hmm.. my motivation to use
self.eq_param_indexwas to use this internal variable when loading a saved solver as otherwise we have to recomputeeq_param_indexagain and pass it in the constructor.