Conversation
| @@ -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
|
|
||
|
|
||
| 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)
| 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
|
|
||
|
|
||
| class CrossSession(object): | ||
| """Cross Session """ |
There was a problem hiding this comment.
Improve docstring (like above)
|
|
||
|
|
||
| class LeaveOneSubjectOut(object): | ||
| """Leave one subject out""" |
There was a problem hiding this comment.
Improve docstring (like above)
| 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?
| # 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?
| @@ -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
|
|
||
| # 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.
| 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.
|
Thank you @ddavidebb , great job! This looks already in a good shape.
e.g, https://www.devdungeon.com/content/import-python-module-string-name If we are able to make the
|
| 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!
…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. |
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.