-
Notifications
You must be signed in to change notification settings - Fork 9
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
Major memory usage optimization in iEEG pipeline #127
Conversation
raw_data['data'] = raw_data['data'][earliest_sample:latest_sample].copy() | ||
raw_data['wav'] = raw_data['wav'][earliest_sample:latest_sample].copy() |
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.
Why do you copy these here?
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.
This was a part of the memory optimization. Returning a slice of the numpy array keeps the entire array alive in memory. Copying momentarily increases memory usage, but then drops the larger array and only keeps the smaller one. I couldn't find a way to discard the unwanted parts without making a copy.
@@ -161,23 +160,30 @@ def filterbank_hilbert(x, fs, Wn=[1,150], n_jobs=-1): | |||
|
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.
Unless you add a parameter like return_average
and set it to False by default, the above Examples section is now broken
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.
Separated this functionality into two functions now: filter_hilbert
and filterbank_hilbert
Reference Issues/PRs
What does this implement/fix? Explain your changes.
Any other comments?