Comments (2)
Dear @rfmiotto, thank you for the effort! We'll check the Merge Request as soon as possible.
Regarding your dubts:
- the dictionaries initialization is performed for all the DMD classes, only to initialize the attributes (nothing related with the MrDMD prediction).
- if I remember correctly, the
try:...except
lines have been added in order to avoid errors that occur when thestep
variable is too large to fit in a single window. Better (and cleaner) solutions are very welcome!
from pydmd.
Dear @ndem0,
Thank you for clarifying.
But can I say that the mrDMD cannot handle predictions? (the dmd_time
is a copy of original_time
)
The solution that I propose in this PR is to limit the maximum level such that the bins at the topmost level are composed of at least 4 snapshots.
# Redefine max level if it is too big.
lvl_threshold = int(np.log(self._snapshots.shape[1]/4.)/np.log(2.))
if self.max_level > lvl_threshold:
self.max_level = lvl_threshold
print('Too many levels. Redefining `max_level` to {}'.format(self.max_level))
Also, I ensured that the minimum admissible step was 1, since slice step cannot be zero:
step = max(1, int(np.floor(old_div(n_samples, nyq))))
The reason for doing that is because (and please, correct me if I am wrong):
In the original code (I mean before this proposed commit), as we go to higher resolution levels the n_samples
decreases up to a point when the n_samples/nyq
becomes < 1. At this point, the step
variable becomes zero, causing a ValueError
to be raised in Xsub = Xraw[:, ::step]
. So the code goes to the exception block and sets the DMD variables (modes, eigenvalues, etc) of that bin as zero.
This approach solves for the zero slice step in Xsub = Xraw[:, ::step]
, but when one tries to reconstruct the dynamics, these zero-valued bins are included in the computation and cause a division by zero error.
To my understanding, the try:..except
blocks were added to solve this step problem. However, I didn't understand what exactly did you mean by the try:...except
to be related to the step being large to fit a window. For example, the code below gives no errors:
a = np.arange(10)
print( a[::7] ) # Out: array([0, 7])
print( a[::25] ) # Out: array([0])
Please, let me know if you agree with that or if my conclusions are wrong.
Thank you and best regards,
Renato Miotto
from pydmd.
Related Issues (20)
- `black` verbosity
- Bug in `test_dmd.test_predict_exact()` HOT 2
- Introduce Mypy checks
- Cookiecutter templates for `DMDBase` subclasses
- Large input data condition number problem
- Some unexpected error on HODMD HOT 2
- Introduce `@override`
- Replace string labels with enums
- plot_eigs method does not seem to work HOT 3
- Using hodmd with parametric rom for 1D snapshots - ValueError: not enough values to unpack (expected 3, got 2)
- How to use ParametricDMD with BOPDMD? HOT 1
- Optional `_check_condition_number` for snapshots HOT 1
- DMD with control cannot reconstruct data when provided with control
- Redundant SVD computation HOT 2
- MrDMD amplitudes HOT 1
- TypeError: plot_summary() got an unexpected keyword argument 'd' HOT 4
- numpy.linalg.LinAlgError: SVD did not converge in Linear Least Squares HOT 2
- Prediction using DMD using windowed data HOT 2
- Zenodo DOI HOT 3
- Broken documentation website 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 pydmd.