| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| @@ -0,0 +1,409 @@ | |||
| import numpy as np | |||
There was a problem hiding this comment.
Please, add a short docstring that explain what we are doing here
Sorry, something went wrong.
|
|
||
|
|
||
| class WithinSession(object): | ||
| """Within Session """ |
There was a problem hiding this comment.
Here you should improve the docstring with a better description of what we are doing + description of the arguments (see other docstrings)
Sorry, something went wrong.
| self.iterator_tag = "within-session" | ||
|
|
||
| def prepare(self, dataset): | ||
| if not (isinstance(dataset, BaseDataset)): |
There was a problem hiding this comment.
Please, add a docstring + description of input/output arguments
Sorry, something went wrong.
|
|
||
|
|
||
| class CrossSession(object): | ||
| """Cross Session """ |
There was a problem hiding this comment.
Improve docstring (like above)
Sorry, something went wrong.
|
|
||
|
|
||
| class LeaveOneSubjectOut(object): | ||
| """Leave one subject out""" |
There was a problem hiding this comment.
Improve docstring (like above)
Sorry, something went wrong.
| if __name__ == "__main__": | ||
| argv = sys.argv[1:] | ||
| # Temporary switching off deprecation warning from mne | ||
| import warnings # noqa |
There was a problem hiding this comment.
Is that needed? I don't use mne used and I think we solved the warning issue in the previous recipe, right?
Sorry, something went wrong.
| # to run on a subset of subjects: moabb_dataset.subject_list = [1, 2, 3, 4] | ||
| moabb_dataset.download(path=hparams["data_folder"]) | ||
| moabb_paradigm = MotorImagery( | ||
| n_classes=4, |
There was a problem hiding this comment.
The number of classes seems hardcoded it. Can we put in the yaml file?
Sorry, something went wrong.
| @@ -0,0 +1,144 @@ | |||
| ################################################### | |||
There was a problem hiding this comment.
Please, write the header. Here is the place where I would mention the EEGNET
Sorry, something went wrong.
|
|
||
| # DIRECTORIES | ||
| data_folder: !PLACEHOLDER #'/path/to/MOABB_BNCI2014001' | ||
| output_folder: '/home/prometheus/Documents/results/MOABB_BNCI2014001' #!ref results/MOABB_BNCI2014001/<seed> |
There was a problem hiding this comment.
I think this should be output_folder: results/MOABB_BNCI2014001/<seed>. Otherwise, it is hardcoded.
Sorry, something went wrong.
| p_drop: 0.5 # dropout rate | ||
| padding_mode: 'constant' | ||
|
|
||
| layer0: !new:speechbrain.nnet.CNN.Conv2d |
There was a problem hiding this comment.
An alternative here would be to define the model in lobes (e.g. speechbrain/lobes/EEGNET.py). However, defining it every time doesn't look that bad to me in the end.
Sorry, something went wrong.
|
Thank you @ddavidebb , great job! This looks already in a good shape.
moabb_dataset= importlib.import_module(hparams["dataset"]) moabb_dataset = moabb_dataset() e.g, https://www.devdungeon.com/content/import-python-module-string-name If we are able to make the train.py dataset independent we can share it across all the datasets that we would like to address. Not sure about that, but maybe we can even create a single train.py for all the MOABB tasks (i.e., not only for Motor imagery detection). What do you think?
|
Sorry, something went wrong.
| return standardized | ||
|
|
||
|
|
||
| def nth(iterable, n, default=None): |
There was a problem hiding this comment.
I think this is used on the StratifiedKFold splits...
don't we want to split the data such that we don't have the same sessions of the same subject on train and test?
I think there's a data leakage problem if we do like this. In fact, you already "know" your subject from the train set.
Maybe this is implemented somewhere else and I am just missing it!
Sorry, something went wrong.
…into eeg_decoding
…ile, added baselines, added EEGConformer, removed DeepConvNet and LMDA
… hparam space of ShallowConvNet and EEGConformer
|
I'm now going to merge the content of this PR in develop and open a new one in speechbrain/benchmarks with the EEG recipes. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This is the first commit for a motor imagery decoding recipe based on a benchmark motor imagery dataset (BNCI2014001).
README and other minors are missing.