Comments (7)
It is because the pykoopman you imported is the one from PyPi, which is a very old version. I just uploaded the 1.0.1 version. You should be able to find the example working now.
from pykoopman.
Thanks! I uninstalled and reinstalled, tried both from git clone and pip install pykoopman.
But it for some reason is not loading correctly:
Traceback (most recent call last):
Cell In[891], line 1
EDMDc = pk.regression.DMDc()
AttributeError: module 'pykoopman' has no attribute 'regression'
I definitely have "regression" folder inside the git cloned folder...
EDIT: it works as from pykoopman.regression import DMDc, so I can do that.
from pykoopman.
please take a look at the cell [5] in https://github.com/dynamicslab/pykoopman/blob/master/docs/tutorial_koopman_hankel_dmdc_for_vdp_system.ipynb
So basically, if you are implementing EDMDc with time delay, set svd_output_rank
or svd_rank
less than the full rank might lead to worse performance.
In fact, this is not a special case. Here is an example in my JFM paper:
- Looking at figure 12 in the following paper, when using EDMD with monomials, choosing a svd rank in the least square does not help.
Reference
- Sparsity-promoting algorithms for the discovery of informative Koopman-invariant subspaces
S Pan, N Arnold-Medabalimi, K Duraisamy
Journal of Fluid Mechanics 917, A18
from pykoopman.
There seems to also be a problem instituting the SVD rank:
from pykoopman.regression import EDMDc
EDMDc = DMDc(svd_rank=20)
n_delays = 71
obs = TimeDelay(n_delays=n_delays)
model = pk.Koopman(observables=obs, regressor=EDMDc)
model.fit(X1.T, y=X2.T, u=U[:,n_delays:len(X)].T)
gives the error:
model.fit(X1.T, y=X2.T, u=U[:,n_delays:len(X)].T)
Traceback (most recent call last):
Cell In[3541], line 1
model.fit(X1.T, y=X2.T, u=U[:,n_delays:len(X)].T)
File ~\anaconda3\envs\DMD\lib\site-packages\pykoopman\koopman.py:170 in fit
self._pipeline.fit(x, y, regressor__u=u, regressor__dt=dt)
File ~\anaconda3\envs\DMD\lib\site-packages\sklearn\pipeline.py:394 in fit
self._final_estimator.fit(Xt, y, **fit_params_last_step)
File ~\anaconda3\envs\DMD\lib\site-packages\pykoopman\regression\_base_ensemble.py:107 in fit
self.regressor_.fit(X, y_trans, **fit_params)
File ~\anaconda3\envs\DMD\lib\site-packages\pykoopman\regression\_dmdc.py:146 in fit
self._fit_unknown_B(X1, X2, C, r, rout)
File ~\anaconda3\envs\DMD\lib\site-packages\pykoopman\regression\_dmdc.py:175 in _fit_unknown_B
assert rout <= r
AssertionError
It works fine when I don't include the svd_rank parameter.
from pykoopman.
can you have a complete self-contained code here? including the data
from pykoopman.
Thanks, that's really helpful!
from pykoopman.
So basically, if you are implementing EDMDc with time delay, set svd_output_rank or svd_rank less than the full rank might lead to worse performance.
It seems like when there is noise in the control signal, it unfortunately leads to overfitting
from pykoopman.
Related Issues (20)
- Documentation typo HOT 1
- No module named optht HOT 2
- AttributeError: 'Koopman' object has no attribute 'V' HOT 2
- Question about the difference between the function named '_compute_phi' and '_compute_psi' HOT 2
- Fitting HOT 2
- PyKoopman for coupled PDEs HOT 1
- Bug in model.fit with timedelays HOT 4
- Running "Neural Network DMD on Slow Manifold" error HOT 1
- `pip install .` does not install dependencies HOT 1
- `python setup.py install` doesn't work HOT 1
- no version ranges for dependencies HOT 4
- You must include `torch` in your setup.py (and `requirements.txt`) if you import torch in the pykoopman package HOT 1
- Installation issue with python 3.12 HOT 3
- changing the activation function HOT 7
- NAN issues
- How to save and load the regressor or model? HOT 3
- Changing time step in `simulate`
- Other norms for fitting? (feature request)
- The predicted derivative.
- nndmd HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pykoopman.