diff --git a/.gitignore b/.gitignore index c24840b..5edaba7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ **/*.ipynb_checkpoints __pycache__ +/.vscode/ \ No newline at end of file diff --git a/brainDecode/__init__.py b/brainDecode/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/brainDecode/towardMoabbIntegration/__init__.py b/brainDecode/towardMoabbIntegration/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/brainDecode/towardMoabbIntegration/utils/bayesian.py b/brainDecode/towardMoabbIntegration/utils/bayesian.py new file mode 100644 index 0000000..bbf7c6e --- /dev/null +++ b/brainDecode/towardMoabbIntegration/utils/bayesian.py @@ -0,0 +1,21 @@ + +from skopt import BayesSearchCV +from skopt.space import Categorical, Real, Integer +from brainDecode.towardMoabbIntegration.brainDecodeSKLearnWrapper.ShallowFBCSPNet_GeneralTrainer import ShallowFBCSPNet_GeneralTrainer + + +def bayes_optimize(classifier=None, X_train=None, Y_train=None): + classifier = ShallowFBCSPNet_GeneralTrainer(nb_epoch=25) + + searches = { # This should containt Dimension instances (Reals, Integer, or Categorical) + "n_filters_time":Integer(5, 15), + "filter_time_length":Integer(50,75), + "n_filters_spat":Integer(3,10), + "pool_time_length":Integer(50,80), + "pool_time_stride":Integer(20,40) + } + + bayes_optmizer = BayesSearchCV(classifier, searches) + + # now fit and profit + bayes_optmizer.fit(X_train, Y_train) \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..34907c9 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,7 @@ +mne>=0.16.1 +seaborn +pandas +scikit-learn +torch==0.4.0 +braindecode==0.4.5 +scikit-optimize==0.5.2