-
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
[BUG] FROLS creates nan entries and then fails #191
Comments
It appears that line 194 of frols.py tries to orthogonalize against a column that has not been initialized yet (and is thus all zeros). @akaptano , @jcallaham , looks like you guys were the ones who worked on FROLS... any ideas? |
@jcallaham is our resident expert on FROLS... I'll let him take this one if he is available. |
Sure, I can take a look. From your MWE it seems like the problem isn't that the column hasn't been initialized yet (since I'm not sure what this test does, or how the ensembling works exactly - would you expect linearly dependent features to be common for that use case? I'd think it would be unusual for standard SINDy, but we could add an exception or warning for the edge case of rank-deficient libraries. I'm not getting any test failures on the latest master branch, and can run the example notebook that uses FROLS okay (14_cavity_flow). I also can't find the |
Current The test failed while refactoring to get #185 to pass on the notebooks... It looks like I was creating ten extra columns: x had shape If we want to raise a more explicit error, this version of def _normed_cov(self, a, b):
with warnings.catch_warnings():
warnings.filterwarnings("error", category=RuntimeWarning)
try:
return np.vdot(a, b) / np.vdot(a, a)
except RuntimeWarning:
raise ValueError("Trying to orthogonalize linearly dependent columns created NaNs") But not sure whether it's better to raise it here or in opt = FROLS(normalize_columns=True)
x = np.array([[1., 1.]])
y = np.array([[1., 1.]])
opt.fit(x, y) |
That makes sense. Yeah I had run into a similar issue trying to debug a related issue a while ago - I like your explicit test. I think having it in |
While refactoring AxesArray to carry around axes labels around pysindy, I ran into a failing FROLS test
test_ensemble_pdes(optimizer)
. I cut down the data to a size that could be posted here, but in that test,x.shape
is (100, 3).MWE
Error message:
ValueError: Input contains NaN, infinity or a value too large for dtype('float64').
PySINDy/Python version information:
Working in my own branch off of master, but haven't modified anything in pysindy.optimizers (and pysindy.optimizers doesn't import from outside the package, e.g. utils.)
That said, tested on 1.7 and MWE still raises error.
The text was updated successfully, but these errors were encountered: