-
Notifications
You must be signed in to change notification settings - Fork 359
SINDyPI implementation via the PDELibrary and WeakPDELibrary #195
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
Conversation
… WeakPDELibrary is similar, but havent figured out the tweights issue to correctly integrate things. Replaced the SINDyPI example with an updated and better example. Waiting on modified KdV data from Kardy to try it out on PDE data. One other issue is generating polynomials of derivative terms. Going to talk to Zack about easiest way to implement since he does this somewhere.
Codecov Report
@@ Coverage Diff @@
## master #195 +/- ##
==========================================
- Coverage 93.78% 92.94% -0.85%
==========================================
Files 33 33
Lines 3297 3329 +32
==========================================
+ Hits 3092 3094 +2
- Misses 205 235 +30
Continue to review full report at Codecov.
|
…kPDELibrary, but now PDELibrary also has such a grid. So can just check for some WeakPDELibrary specific attribute like Hxt instead. There will definitely be future issues with the ensembling.
|
Will take a look at this in the next day or two--it should be easy! |
|
@akaptano I think I got the weak library acting correctly for the implicit_terms case--there was just one minor change, to rescale the weights if they include time derivatives correctly (the old library assumed the time derivative order was 0 around line 508 when it computes the scaling factor |
When will implicit_terms be available in weak_pde_library? |
I've completed a first pass at implementing this (see #185), but that PR includes a lot of updates. The other developers will need to review the changes before we make a new release. In the meanwhile, if you'd like to test the new features, you can install the package from a clone of the repository on the simplify-fitting brach, e.g., Let us know if you try it out and notice and issues. |
|
Hi guys,
Let me know how I can help. Thanks!
On Fri, Jun 17, 2022 at 3:05 AM Zachary Nicolaou ***@***.***> wrote:
When will implicit_terms be available in weak_pde_library?
I've completed a first pass at implementing this (see #185
<#185>), but that PR includes
a lot of updates. The other developers will need to review the changes
before we make a new release. In the meanwhile, if you'd like to test the
new features, you can install the package from a clone of the repository on
the simplify-fitting brach, e.g.,
git clone ***@***.***:dynamicslab/pysindy.git
cd pysindy
git checkout simplify-fitting
pip install -r requirements-dev.txt
jupyter notebook examples/9_sindypi_with_sympy.ipynb
Let us know if you try it out and notice and issues.
—
Reply to this email directly, view it on GitHub
<#195 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIDALZU4NNXBC3HRJBW5SHTVPQWVHANCNFSM5X5XFG2Q>
.
You are receiving this because your review was requested.Message ID:
***@***.***>
--
Best Regards,
Kadierdan Kaheman
Research Assistant, Brunton's Lab
Ph.D., Mechanical Engineering
University of Washington, Seattle, WA
206-3720-632
|
Thanks, @KKahirman ! Just take a look at the example notebook 9, and see if I'm misrepresenting any results! It's terse and rough now also, so feel free to add details also if you'd like. |
BUG. Everytime I rerun a code it will give different result particularly the coefficients..... For instance, x0x0 = -0.312 1 + 0.151 x0 + 0.010 x1 + 0.072 x0x1 + 2.824 x5 + -12.574 x0x5 + 5.437 x0x0x5 + 0.127 x0x3 + 0.034 x0x0x3 and x0x0 = -0.328 1 + 0.169 x0 + 0.010 x1 + 0.073 x0x1 + 2.960 x5 + -13.206 x0x5 + 5.545 x0x0x5 + 0.127 x0x3 + 0.034 x0x0x3. |
|
Not sure why this is but if I had to guess I would say this is from cvxpy calling a solver with a nondeterministic initial guess or something like that. Try increasing the error_tolerance and see if you start getting more converged results. |
* The current use of `pre_model_hook` only applied the hook in training. This can be useful, but UMAL requires the hook also in validation and test. Thus, with the old setup UMAL only worked for the training. My propsoed changes make the `pre_model_hook` part of the model, apply it everywhere, and allow UMAL validation and evaluation. I think in the future we should also allow for different hook behaviors according to the setting at which it is called. But, for now the proposed changes are enough. * Simpler Hook and Cleaner Pipeline This commit comprises two things. (1) A pre model hook that is simpler than the one in original PR. (2) An idea to avoid copying the whole dataset that just involves a copy of the labels. That is still suboptimal in terms of memory use, but make the overall code simpler. Not sure if it is the best version. However, at some point we have to extend the labels for the loss, and we need to do so withouth breaking the whole downstream procedure. So maybe this is a good middle ground. * Simplified UMAL Sampling Logic This commit implements an idea from Martin that simplifies the sampling logic of the UMAL sampling util so that the sampling automatically checks whether the data has been extended. Thus no extra argument is required for the function call for `sample_umal`. * Spell correction neuralhydrology/modelzoo/basemodel.py Updated comment so that additional is spelled correctly Co-authored-by: Martin Gauch <[email protected]> * Spell correction for neuralhydrology/utils/samplingutils.py UMAl -> UMAL Co-authored-by: Martin Gauch <[email protected]> * Imporvement for Comments Added some minor changes to the comments. --------- Co-authored-by: Martin Gauch <[email protected]>
* Fix typo in models doc (dynamicslab#190) * CPU environment now pulls from conda forge, which is necessary to ensure an up-to-date xarray. (dynamicslab#193) * Fix handling of weekly frequencies. (dynamicslab#194) From neuralhydrology/neuralhydrology#111: pd.infer_freq will return strings like "W-SUN" for weekly data, which pd.Timestamp doesn't understand. We now convert these frequencies to their equivalent multiple of 7D. * Correcting the pre model hook and UMAL sampling (dynamicslab#195) * The current use of `pre_model_hook` only applied the hook in training. This can be useful, but UMAL requires the hook also in validation and test. Thus, with the old setup UMAL only worked for the training. My propsoed changes make the `pre_model_hook` part of the model, apply it everywhere, and allow UMAL validation and evaluation. I think in the future we should also allow for different hook behaviors according to the setting at which it is called. But, for now the proposed changes are enough. * Simpler Hook and Cleaner Pipeline This commit comprises two things. (1) A pre model hook that is simpler than the one in original PR. (2) An idea to avoid copying the whole dataset that just involves a copy of the labels. That is still suboptimal in terms of memory use, but make the overall code simpler. Not sure if it is the best version. However, at some point we have to extend the labels for the loss, and we need to do so withouth breaking the whole downstream procedure. So maybe this is a good middle ground. * Simplified UMAL Sampling Logic This commit implements an idea from Martin that simplifies the sampling logic of the UMAL sampling util so that the sampling automatically checks whether the data has been extended. Thus no extra argument is required for the function call for `sample_umal`. * Spell correction neuralhydrology/modelzoo/basemodel.py Updated comment so that additional is spelled correctly Co-authored-by: Martin Gauch <[email protected]> * Spell correction for neuralhydrology/utils/samplingutils.py UMAl -> UMAL Co-authored-by: Martin Gauch <[email protected]> * Imporvement for Comments Added some minor changes to the comments. --------- Co-authored-by: Martin Gauch <[email protected]> * Update __about__.py --------- Co-authored-by: Martin Gauch <[email protected]> Co-authored-by: Grey Nearing <[email protected]> Co-authored-by: Daniel Klotz <[email protected]>
Currently the SINDyPI implementation is quite weak in the code, and there is no compatibility for using SINDy-PI on general PDEs. This branch deprecates the SINDyPILibrary class and implements this functionality within the PDE and WeakPDE classes. There remain some open issues: