-
Notifications
You must be signed in to change notification settings - Fork 24
addressing #70 #132
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
addressing #70 #132
Conversation
…ook to demonstrate usage of method finder, improved a comment in the utils, removed some whitespace in the 2b notebook
| 'window_size': [3, 10, 30, 50, 90, 130]}, | ||
| {'gamma': (1e-4, 1e7), | ||
| 'window_size': (1, 1000)}), | ||
| 'window_size': (3, 1000)}), |
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.
A window size of 1 isn't really doing any smoothing.
| if window_size % 2 == 0: | ||
| window_size += 1 # has to be odd | ||
| warn("Kernel window size should be odd. Added 1 to length.") | ||
| ramp = window_size//5 |
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.
If the window_size is too small, ramp can end up being 0. If I set it to have a minimum value of 1, then that change alone is insufficient and causes indexing errors deeper in the slide_function or divide-by-zero errors even deeper in the solvers. Perhaps there is a way to catch and deal with those, but not without more significant debugging and tracing. Instead, I've decided sliding jerk isn't really a reasonable thing to do below a certain window size and am simply calling jerk in that case.
| dxdt_hat[:2] = np.diff(x_hat[:3]) | ||
| dxdt_hat[-2:] = np.diff(x_hat[-3:]) | ||
| dxdt_hat[1] = (x_hat[2] - x_hat[0])/2 | ||
| dxdt_hat[-2] = (x_hat[-1] - x_hat[-3])/2 # use second-order formula for next-to-endpoints so as not to amplify noise |
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.
Off theme for this PR, sorry.
| if window_size % 2 == 0: window_size += 1 # window_size needs to be odd | ||
| if window_size % 2 == 0: | ||
| window_size += 1 # window_size needs to be odd | ||
| warn("Kernel window size should be odd. Added 1 to length.") |
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.
I raised this warning for other methods, but not for this one.
Very simple automatic metamethod. We're currently still requiring the user to give a cutoff frequency or ground truth.