Skip to content

memory consuming #35

Closed
Closed

Description

@guishuyunye-lyw

MemoryError: Unable to allocate 9.75 GiB for an array with shape (6545, 100001) and data type complex128

It just cannot work on a big dataset, which is just 500mb.

Activity

  1. yjmantilla commented on Aug 12, 2020

    @yjmantilla
    Collaborator

    My intuition is that this comes from the multitaper (The ransac would throw another error ). Please refer to #18 . Specifically you need a patch for the multitaper described in there or alternatively apply another filtering method for the line noise while passing an empty list to the line_freqs parameter.

  2. sappelhoff commented on Aug 12, 2020

    @sappelhoff
    Owner

    We basically need MNE-Python master with the window-wise spectrum filter (see mne-tools/mne-python#7609) and then @christian-oreilly's patch to include that in pyprep.

  3. guishuyunye-lyw commented on Aug 13, 2020

    @guishuyunye-lyw
    Author

    How to make it happen? Could you offer some specific alternative codes or example for us to imitate temporarily.

  4. guishuyunye-lyw commented on Aug 13, 2020

    @guishuyunye-lyw
    Author

    My intuition is that this comes from the multitaper (The ransac would throw another error ). Please refer to #18 . Specifically you need a patch for the multitaper described in there or alternatively apply another filtering method for the line noise while passing an empty list to the line_freqs parameter.

    I just made the line_freqs=[0], but it still broken off. Could you give me an example how to achieve what you described. THX so much!

  5. yjmantilla commented on Aug 13, 2020

    @yjmantilla
    Collaborator

    @guishuyunye-lyw rather than making line_freqs = [0], make it empty (line_freqs = []) . That will skip the line noise filtering.

    Now if you do have line_noise you have two options. Either make a notch filter with mne for the line noise (https://mne.tools/stable/auto_tutorials/preprocessing/plot_30_filtering_resampling.html?highlight=notch) outside of the pyprep (preferably before) or use the patch of #18 .

    I havent implemented the patch myself but I think it is already merged in MNE so you would need to install mne from the latest code ( https://github.com/mne-tools/mne-python for instructions). I think that would be enough along with passing the line_freqs you want. We are still unsure how much it actually attenuates the line noise but at least it wont explode in ram consumption.

    There is another patch made by @christian-oreilly that (as far as i know) helps in case you want to keep non eeg channels in your data (ie ocular channels).

    I don't really have time to provide code from scratch but if you post yours here we may be able to indicate to you what changes to make.

  6. yjmantilla commented on Aug 24, 2020

    @yjmantilla
    Collaborator

    @guishuyunye-lyw were you able to do it? can we close this?

  7. sappelhoff commented on Sep 28, 2020

    @sappelhoff
    Owner

    @yjmantilla now that MNE-Python 0.21 is out, do you have time to make a PR against pyprep to set the spectrum filter to default to work in windowed mode (with 10s windows by default)? And perhaps test whether that'd a good idea?

    We could also add a new parameter filter_kwargs which would be a dictionary that, if supplied, gets passed on the the spectrum filter call. that way, users could tweak the spectrum filter to their own liking more completely ... and if they don't do that, the default values should be reasonable.

    WDYT?

  8. yjmantilla commented on Sep 29, 2020

    @yjmantilla
    Collaborator

    @sappelhoff next week's tuesday I will get rid of an university exam and by then I will probably have the time to make the PR.

  9. sappelhoff commented on Sep 30, 2020

    @sappelhoff
    Owner

    okay cool, note also this (from the changelog of mne 0.21):

    The default window size set by filter_length when method='spectrum_fit' in mne.io.Raw.notch_filter() will change from None (use whole file) to '10s' in 0.22, by Eric Larson

    https://mne.tools/stable/whats_new.html#whats-new

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions