Skip to content
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

Deprecated deep learning #666

Open
wants to merge 21 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
6fddf25
MNT: fixing the numpy 2.0
bruAristimunha Oct 18, 2024
8d10215
DOC: fixing the docstring
bruAristimunha Oct 18, 2024
83add19
DOC: fixing the docstring
bruAristimunha Oct 18, 2024
06c0b97
DOC: fixing more numpy
bruAristimunha Oct 18, 2024
cd992dc
DOC: deprecated braindecode inside moabb module in favor of braindecode
bruAristimunha Oct 18, 2024
dd25e85
DOC: updating whats_new.rst file
bruAristimunha Oct 18, 2024
54db463
DOC: fixing whats_new.rst
bruAristimunha Oct 18, 2024
1c7a100
Merge branch 'fixing_numpy' into deprecated-deep-learning
bruAristimunha Oct 18, 2024
33ca7f4
DOC: fixing api doc rst
bruAristimunha Oct 18, 2024
0befa98
Merge branch 'develop' into deprecated-deep-learning
bruAristimunha Oct 18, 2024
ff077dc
DOC: removing braindecode
bruAristimunha Oct 18, 2024
ce7d57c
Merge remote-tracking branch 'origin/deprecated-deep-learning' into d…
bruAristimunha Oct 18, 2024
d473045
Merge branch 'develop' into deprecated-deep-learning
bruAristimunha Oct 18, 2024
fdd2ccd
DOC: removing braindecode
bruAristimunha Oct 18, 2024
07f0aae
[FIX] removing optional poetry dependancy.
bruAristimunha Nov 11, 2024
f76ee73
[FIX] removing options about braindecode
bruAristimunha Nov 11, 2024
942c1d6
[FIX] removing options about braindecode
bruAristimunha Nov 11, 2024
9ce2756
[FIX] removing braindecode
bruAristimunha Nov 11, 2024
4095212
[FIX] removing braindecode
bruAristimunha Nov 11, 2024
88395be
Merge branch 'develop' into deprecated-deep-learning
bruAristimunha Nov 11, 2024
2dd4e8b
Merge branch 'develop' into deprecated-deep-learning
bruAristimunha Nov 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions docs/source/pipelines.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,3 @@ Base & Utils
utils_deep_model.EEGNet
utils_deep_model.EEGNet_TC
utils_deep_model.TCN_block
utils_pytorch.BraindecodeDatasetLoader
utils_pytorch.InputShapeSetterEEG
1 change: 1 addition & 0 deletions docs/source/whats_new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Bugs

API changes
~~~~~~~~~~~
- Removing the braindecode module from inside moabb (:gh:`666` by `Bruno Aristimunha`_ )

Version - 1.1.1 (Stable - PyPi)
---------------------------------
Expand Down
52 changes: 2 additions & 50 deletions examples/load_model.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
==============================================
Load Model (Scikit, Pytorch, Keras) with MOABB
Load Model (Scikit, Keras) with MOABB
==============================================

This example shows how to use load the pretrained pipeline in MOABB.
Expand All @@ -13,13 +13,8 @@
from pickle import load

import keras
import torch
from braindecode import EEGClassifier
from braindecode.models import EEGInception
from scikeras.wrappers import KerasClassifier
from sklearn.pipeline import Pipeline, make_pipeline
from skorch.callbacks import EarlyStopping, EpochScoring
from skorch.dataset import ValidSplit
from sklearn.pipeline import Pipeline

from moabb import set_log_level
from moabb.pipelines.features import StandardScaler_Epoch
Expand Down Expand Up @@ -66,46 +61,3 @@
("Keras_DeepConvNet_Trained", Keras_DeepConvNet_Trained),
]
)

###############################################################################
# Loading the PyTorch model

# Hyperparameter
LEARNING_RATE = 0.0001
WEIGHT_DECAY = 0
BATCH_SIZE = 64
SEED = 42
VERBOSE = 1
EPOCH = 2
PATIENCE = 3

# Define a Skorch classifier
clf = EEGClassifier(
module=EEGInception,
optimizer=torch.optim.Adam,
optimizer__lr=LEARNING_RATE,
batch_size=BATCH_SIZE,
max_epochs=EPOCH,
train_split=ValidSplit(0.2, random_state=SEED),
callbacks=[
EarlyStopping(monitor="valid_loss", patience=PATIENCE),
EpochScoring(
scoring="accuracy", on_train=True, name="train_acc", lower_is_better=False
),
EpochScoring(
scoring="accuracy", on_train=False, name="valid_acc", lower_is_better=False
),
],
verbose=VERBOSE, # Not printing the results for each epoch
)

clf.initialize()

f_params = "./results/Models_CrossSession/BNCI2014-001/1/braindecode_EEGInception/EEGInception_fitted_best_model.pkl"
f_optimizer = "./results/Models_CrossSession/BNCI2014-001/1/braindecode_EEGInception/EEGInception_fitted_best_optim.pkl"
f_history = "./results/Models_CrossSession/BNCI2014-001/1/braindecode_EEGInception/EEGInception_fitted_best_history.json"

clf.load_params(f_params=f_params, f_optimizer=f_optimizer, f_history=f_history)

# Create the pipelines
pipes_pytorch = make_pipeline(clf)
59 changes: 0 additions & 59 deletions examples/pipelines_braindecode/braindecode_EEGInception.py

This file was deleted.

59 changes: 0 additions & 59 deletions examples/pipelines_braindecode/braindecode_EEGNetv4.py

This file was deleted.

59 changes: 0 additions & 59 deletions examples/pipelines_braindecode/braindecode_ShallowFBCSPNet.py

This file was deleted.

122 changes: 0 additions & 122 deletions examples/plot_benchmark_braindecode.py

This file was deleted.

Loading
Loading