-
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
Parametric library #273
Parametric library #273
Conversation
…ysindy into parametric_library
Codecov ReportBase: 92.39% // Head: 92.47% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #273 +/- ##
==========================================
+ Coverage 92.39% 92.47% +0.08%
==========================================
Files 36 37 +1
Lines 3682 3736 +54
==========================================
+ Hits 3402 3455 +53
- Misses 280 281 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Nice! I'll try to take a look this week. By the way, it would be nice to overhaul the GeneralizedLibrary notation anyways. The inputs_per_library and array to tell it which libraries to use for which variables is super confusing to use, and I get lots of questions on it. At the very least, it might be worth putting the indexing in the backend, and having the user interface be a lot easier to specify exactly what you want the libraries to do. |
@akaptano totally agree the |
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.
Looks good! -just a consideration with the AxesArray
choice, and a few list comprehensions.
Ok! I think I resolved issues from @Jacob-Stevens-Haas -- thanks! Let me know if anything else looks off. |
bump @akaptano -- let me know if you want to take a look at this one before I merge with master this week |
Going to take a look at this today for some documentation/other checks but not going to get into the technical details (need to spend time getting the other PR + paper ready still). If I have any suggestions I'll let you know by the end of the day! |
…ut going to put rest of the comments in the PR request
My main comment so far is that the example notebook could be substantially cleaned up in terms of: I started to do a little bit of this in a new commit but then realized this would be a big change so commenting here instead. |
Other random comments:
Anyways, this is awesome and my main comment is to clean up the notebook considerably. Let me know if you need a hand with anything, and sorry for my slowness on this! |
Thanks for the feedback @akaptano! All very reasonable--I'll clean things up and organize some short examples for the other notebooks. |
…. Added automatic reshaping and broadcasting to control parameter input and included short example in notebook 1 also.
…. Added automatic reshaping and broadcasting to control parameter input and included short example in notebook 1 also.
…. Added automatic reshaping and broadcasting to control parameter input and included short example in notebook 1 also.
Hey Zack, the notebook is looking much better. I think you could probably move even more functions/plotting into the utils.py file, but this has a green light for me when you're happy to merge it in. |
Thanks @akaptano ! I am pushing just one more clean up and am going to merge later tonight! |
Parametric library
I think I'm ready to merge the new ParameterizedLibrary class and example notebook with master!
Changes to the core code are pretty minor. They include
GeneralizedLibrary
for a specific use case. This case is when multiple trajectories are supplied that are governed by the same equations but with different parameter values. The parameter values are supplied as control input. It is important to construct the library features carefully in this case for PDE's, since we don't want to take spatial derivatives of the constant control parameters, so the library takes an inputfeature_library
and an inputparameter_library
that act on the data and control input independently. The full library is essentially aTensoredLibrary
of the two, but theGeneralizedLibrary
enables different input features for the libraries.exclude_libraries
option toGeneralizedLibrary
, which enables more control. In our case, we want to include only the tensor products of the input, and not concatenate the individual libraries as well, since that would lead to repeated columns in the usual case where theparameter_library
has a constant bias term.differentiation_method
option to thePDELibrary
and theWeakPDELibrary
, to allow the user to change the differentiation method for the spatial derivatives. This addresses issue Add differentiation_method to PDELibrary and WeakPDELibrary #221AxesArray
, so that if noaxes
are provided, the axes are comprehended withcomprehend_axes
.Most of the work here is in the example notebook examples/17_pattern_formation/17_pattern_formation.ipynb, which has several examples including discrete maps, ODEs, and PDEs. Many of the examples are spatio-temporal and require pretty significant memory and cpu resources, so if you want to run them, you may want to do so on a cluster.
I'm hoping to merge this in the next week or so before we post an accompanying preprint on arxiv. Let me know if you want to see any details from the manuscript!