-
Notifications
You must be signed in to change notification settings - Fork 327
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
[BUG]SINDy defaults are instances of classes #68
Comments
The standard solution is to set the default values to E.g. if optimizer is None:
self.optimizer = STLSQ()
else:
self.optimizer = optimizer I can submit a pull-request to fix this if you like. |
This is a great suggestion, thanks! If you'd like to submit a pull-request, please do. Otherwise I can make the fix sometime in the next 24 hours. |
Now I'm getting 1 test fail. Any idea how this change to
How does this test work? |
Actually, this is not related. I just rolled back my changes and this test was failing before. My changes pass |
The test failure you saw is troubling. I will have to look into it separately. |
I don't think it's a good idea to use instances of
optimizer
,feature_library
, anddifferentiation_method
as default values in the init method of the SINDy class because they will only be instantiated once and then all future instances of SINDy will be using the same instances of these classes.To illustrate the problem:
Output:
(
model_1
andmodel_2
are sharing the same default optimizer object, furthermore, all future instances of SINDy will also be).The problem is in the init method for SINDy:
The text was updated successfully, but these errors were encountered: