-
Notifications
You must be signed in to change notification settings - Fork 357
Description
When I proposed to combine the derivative and sparse regression step into a single optimization problem, it was clear that I couldn't use the existing SINDy class without some weird hacks (i.e. creating a SingleStepOptimizer that omitted
- All the feature libraries that re-implement custom functions a la [BUG] Can we remove support for PDELibrary with no spatial derivatives or grid? #192
- The churn around
SINDyPIOptimizerandSINDyPILibrary - The weirdness of indirecting the differentiation library in a call to
FeatureLibrary.calc_trajectory - The danger of using a
TensoredLibraryorGeneralizedLibrarywith aWeakLibraryand theisinstance()hacks to detect this. - The inability to use other sparse optimizers for a trapping problem
- General questions about which other problem setup choices are mathematically compatible with Trapping
- The legacy of letting feature libraries do their own ensembling
It became clear to me that if I made SingleStepSINDy a subclass of SINDy, I could do things much more clearly. By not taking a differentiation method, I would prevent users from thinking it made a difference. I could accept any existing Feature Library (other than weak features). And I could add a virtual base class for the optimizers that were compatible with my method (that only applied sparsity to a subset of the optimization variable, when I build this).
And so I ask - are weak, parallel, and trapping problems truly a question of feature library/optimizer (and therefore compatible with other choices of differentiation method/feature library/optimizer) or are they mutually incompatible problem setups? If the latter, I think it makes a lot more sense to promote them to sublcasses of SINDy. This would allow them to keep their own logic, but probably reduce the SLOCs that you exclusively manage and perhaps the multiplicity of tests.
I'm not as familiar with these methods, and knowing how to PR these would involve a more deep reading and understanding the papers and the code (except for PI, which is pretty straightforward). But removing ensembling from the SINDy class (among other things) was the first step, and #319 and #338 would also slim down the SINDy class substantially, making subclassing easier.
Thoughts?