-
Notifications
You must be signed in to change notification settings - Fork 179
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
Adding Braindecode pipeline #328
Conversation
Hi @agramfort! You are more than welcome to review the code if you have some space in your schedule. I understand that the benefit of this wrapper is tremendous for braindecode—an extremely simplified way to benchmark multiple moabb datasets with any braindecode model. |
I don't have enough background on moabb but I am super excited to see this happening ! thx @bruAristimunha 🙏 |
Hi @agramfort! I really appreciate your message, and I understand that it may be different. Insisting just a bit, I wanted to share a positive aspect of your revision - the library seems similar to scikit-learn and pyriemann, with classes like the transformations and pipelines in sklearn. Would you mind looking at a tutorial on how braindecode fits in? I can put together something similar to what I showed earlier: braindecode/braindecode#46 (comment) I think it will be something very close to your revisions in braindecode and pyriemann. I greatly respect your time and expertise, and I'd really appreciate your help with this, but I totally understand if that's not possible. |
I think, we need to change the poetry command to install everything using the new optional libraries. |
Ok, I wanted to propose a version that relies on |
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.
We should identify the origin of the predict_proba error
Co-authored-by: Sylvain Chevallier <sylvain.chevallier@universite-paris-saclay.fr>
Thanks @bruAristimunha and @carraraig ! 🙏 |
Hi @sylvchev!
This is a work in progress to add the braindecode object to moabb. I need your assistance with this task.
In the file moabb/pipelines/braindecode.py, I create two custom classes for working with the braindecode library and scikit-learn classifiers.
The
CreateBraindecodeDataset
class serves as a transformer that converts aBaseEpochs
object from themne
library into aWindowsDataset
object from thebraindecode
library. We can evolve this first class/transformation to handle the raw data, and window sliding becomes a parameter.The
BraindecodeClassifierModel
class is a classifier that wraps any classifier from EEGClassifier, providing a consistent interface for fitting the classifier to aWindowsDataset
, making predictions, and computing predicted probabilities. In theory, this wrapper is not necessary, as long as we make this code sequence with the object returned by theEEGClassifier
. It's a design decision.My points of concern for this part are mainly contained in the second file, pipelines/braindecode.py. To generate the
EEGClassifier
object, we need to have then_classes
,n_chans
and theinput_window_samples
. And I understand this is handled more dynamically with moabb.