braindecode 0.2.1__tar.gz → 0.3.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. {Braindecode-0.2.1 → Braindecode-0.3.1}/Braindecode.egg-info/PKG-INFO +2 -11
  2. {Braindecode-0.2.1 → Braindecode-0.3.1}/PKG-INFO +2 -11
  3. {Braindecode-0.2.1 → Braindecode-0.3.1}/README.rst +1 -10
  4. {Braindecode-0.2.1 → Braindecode-0.3.1}/braindecode/datasets/bcic_iv_2a.py +2 -2
  5. {Braindecode-0.2.1 → Braindecode-0.3.1}/braindecode/datautil/iterators.py +7 -3
  6. {Braindecode-0.2.1 → Braindecode-0.3.1}/braindecode/datautil/splitters.py +27 -0
  7. Braindecode-0.3.1/braindecode/datautil/trial_segment.py +625 -0
  8. {Braindecode-0.2.1 → Braindecode-0.3.1}/braindecode/experiments/experiment.py +36 -12
  9. {Braindecode-0.2.1 → Braindecode-0.3.1}/braindecode/experiments/monitors.py +56 -9
  10. {Braindecode-0.2.1 → Braindecode-0.3.1}/braindecode/models/deep4.py +23 -11
  11. {Braindecode-0.2.1 → Braindecode-0.3.1}/braindecode/models/shallow_fbcsp.py +17 -11
  12. {Braindecode-0.2.1 → Braindecode-0.3.1}/braindecode/torch_ext/util.py +17 -1
  13. Braindecode-0.3.1/braindecode/version.py +1 -0
  14. {Braindecode-0.2.1 → Braindecode-0.3.1}/braindecode/visualization/plot.py +0 -2
  15. {Braindecode-0.2.1 → Braindecode-0.3.1}/docs/index.rst +1 -10
  16. Braindecode-0.3.1/docs/notebooks/BBCI_Data.ipynb +841 -0
  17. Braindecode-0.3.1/docs/notebooks/BBCI_Data_Start_Stop.ipynb +899 -0
  18. Braindecode-0.3.1/docs/notebooks/BBCI_Data_Trialwise.ipynb +715 -0
  19. Braindecode-0.3.1/docs/notebooks/Experiment_Class.ipynb +804 -0
  20. {Braindecode-0.2.1 → Braindecode-0.3.1}/docs/notebooks/TrialWise_Decoding.ipynb +12 -12
  21. Braindecode-0.3.1/docs/notebooks/visualization/Perturbation.ipynb +760 -0
  22. Braindecode-0.2.1/braindecode/datautil/trial_segment.py +0 -312
  23. Braindecode-0.2.1/braindecode/version.py +0 -1
  24. Braindecode-0.2.1/docs/notebooks/BBCI_Data.ipynb +0 -845
  25. Braindecode-0.2.1/docs/notebooks/BBCI_Data_Start_Stop.ipynb +0 -802
  26. Braindecode-0.2.1/docs/notebooks/BBCI_Data_Trialwise.ipynb +0 -839
  27. Braindecode-0.2.1/docs/notebooks/Experiment_Class.ipynb +0 -804
  28. Braindecode-0.2.1/docs/notebooks/visualization/Perturbation.ipynb +0 -753
  29. {Braindecode-0.2.1 → Braindecode-0.3.1}/Braindecode.egg-info/SOURCES.txt +0 -0
  30. {Braindecode-0.2.1 → Braindecode-0.3.1}/Braindecode.egg-info/dependency_links.txt +0 -0
  31. {Braindecode-0.2.1 → Braindecode-0.3.1}/Braindecode.egg-info/not-zip-safe +0 -0
  32. {Braindecode-0.2.1 → Braindecode-0.3.1}/Braindecode.egg-info/requires.txt +0 -0
  33. {Braindecode-0.2.1 → Braindecode-0.3.1}/Braindecode.egg-info/top_level.txt +0 -0
  34. {Braindecode-0.2.1 → Braindecode-0.3.1}/LICENSE.txt +0 -0
  35. {Braindecode-0.2.1 → Braindecode-0.3.1}/MANIFEST.in +0 -0
  36. {Braindecode-0.2.1 → Braindecode-0.3.1}/braindecode/__init__.py +0 -0
  37. {Braindecode-0.2.1 → Braindecode-0.3.1}/braindecode/datasets/__init__.py +0 -0
  38. {Braindecode-0.2.1 → Braindecode-0.3.1}/braindecode/datasets/bbci.py +0 -0
  39. {Braindecode-0.2.1 → Braindecode-0.3.1}/braindecode/datasets/multiple.py +0 -0
  40. {Braindecode-0.2.1 → Braindecode-0.3.1}/braindecode/datasets/sensor_positions.py +0 -0
  41. {Braindecode-0.2.1 → Braindecode-0.3.1}/braindecode/datautil/__init__.py +0 -0
  42. {Braindecode-0.2.1 → Braindecode-0.3.1}/braindecode/datautil/signal_target.py +0 -0
  43. {Braindecode-0.2.1 → Braindecode-0.3.1}/braindecode/datautil/signalproc.py +0 -0
  44. {Braindecode-0.2.1 → Braindecode-0.3.1}/braindecode/datautil/util.py +0 -0
  45. {Braindecode-0.2.1 → Braindecode-0.3.1}/braindecode/experiments/__init__.py +0 -0
  46. {Braindecode-0.2.1 → Braindecode-0.3.1}/braindecode/experiments/stopcriteria.py +0 -0
  47. {Braindecode-0.2.1 → Braindecode-0.3.1}/braindecode/mne_ext/__init__.py +0 -0
  48. {Braindecode-0.2.1 → Braindecode-0.3.1}/braindecode/mne_ext/signalproc.py +0 -0
  49. {Braindecode-0.2.1 → Braindecode-0.3.1}/braindecode/models/__init__.py +0 -0
  50. {Braindecode-0.2.1 → Braindecode-0.3.1}/braindecode/models/eegnet.py +0 -0
  51. {Braindecode-0.2.1 → Braindecode-0.3.1}/braindecode/models/util.py +0 -0
  52. {Braindecode-0.2.1 → Braindecode-0.3.1}/braindecode/torch_ext/__init__.py +0 -0
  53. {Braindecode-0.2.1 → Braindecode-0.3.1}/braindecode/torch_ext/constraints.py +0 -0
  54. {Braindecode-0.2.1 → Braindecode-0.3.1}/braindecode/torch_ext/functions.py +0 -0
  55. {Braindecode-0.2.1 → Braindecode-0.3.1}/braindecode/torch_ext/init.py +0 -0
  56. {Braindecode-0.2.1 → Braindecode-0.3.1}/braindecode/torch_ext/losses.py +0 -0
  57. {Braindecode-0.2.1 → Braindecode-0.3.1}/braindecode/torch_ext/modules.py +0 -0
  58. {Braindecode-0.2.1 → Braindecode-0.3.1}/braindecode/util.py +0 -0
  59. {Braindecode-0.2.1 → Braindecode-0.3.1}/braindecode/visualization/__init__.py +0 -0
  60. {Braindecode-0.2.1 → Braindecode-0.3.1}/braindecode/visualization/perturbation.py +0 -0
  61. {Braindecode-0.2.1 → Braindecode-0.3.1}/docs/Makefile +0 -0
  62. {Braindecode-0.2.1 → Braindecode-0.3.1}/docs/conf.py +0 -0
  63. {Braindecode-0.2.1 → Braindecode-0.3.1}/docs/notebooks/Cropped_Decoding.ipynb +0 -0
  64. {Braindecode-0.2.1 → Braindecode-0.3.1}/docs/source/braindecode.datasets.rst +0 -0
  65. {Braindecode-0.2.1 → Braindecode-0.3.1}/docs/source/braindecode.datautil.rst +0 -0
  66. {Braindecode-0.2.1 → Braindecode-0.3.1}/docs/source/braindecode.experiments.rst +0 -0
  67. {Braindecode-0.2.1 → Braindecode-0.3.1}/docs/source/braindecode.mne_ext.rst +0 -0
  68. {Braindecode-0.2.1 → Braindecode-0.3.1}/docs/source/braindecode.models.rst +0 -0
  69. {Braindecode-0.2.1 → Braindecode-0.3.1}/docs/source/braindecode.rst +0 -0
  70. {Braindecode-0.2.1 → Braindecode-0.3.1}/docs/source/braindecode.torch_ext.rst +0 -0
  71. {Braindecode-0.2.1 → Braindecode-0.3.1}/docs/source/braindecode.visualization.rst +0 -0
  72. {Braindecode-0.2.1 → Braindecode-0.3.1}/docs/source/modules.rst +0 -0
  73. {Braindecode-0.2.1 → Braindecode-0.3.1}/setup.cfg +0 -0
  74. {Braindecode-0.2.1 → Braindecode-0.3.1}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.1
2
2
  Name: Braindecode
3
- Version: 0.2.1
3
+ Version: 0.3.1
4
4
  Summary: A deep learning toolbox to decode raw time-domain EEG.
5
5
  Home-page: https://github.com/robintibor/braindecode
6
6
  Author: Robin Tibor Schirrmeister
@@ -30,16 +30,7 @@ Description: Note: The old braindecode repository has been moved to
30
30
 
31
31
  pip install numpy
32
32
 
33
- 3. Install newest version of python-mne:
34
-
35
- .. code-block:: bash
36
-
37
- git clone git://github.com/mne-tools/mne-python.git
38
- cd mne-python
39
- python setup.py install
40
-
41
-
42
- 4. Install braindecode via pip:
33
+ 3. Install braindecode via pip:
43
34
 
44
35
  .. code-block:: bash
45
36
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.1
2
2
  Name: Braindecode
3
- Version: 0.2.1
3
+ Version: 0.3.1
4
4
  Summary: A deep learning toolbox to decode raw time-domain EEG.
5
5
  Home-page: https://github.com/robintibor/braindecode
6
6
  Author: Robin Tibor Schirrmeister
@@ -30,16 +30,7 @@ Description: Note: The old braindecode repository has been moved to
30
30
 
31
31
  pip install numpy
32
32
 
33
- 3. Install newest version of python-mne:
34
-
35
- .. code-block:: bash
36
-
37
- git clone git://github.com/mne-tools/mne-python.git
38
- cd mne-python
39
- python setup.py install
40
-
41
-
42
- 4. Install braindecode via pip:
33
+ 3. Install braindecode via pip:
43
34
 
44
35
  .. code-block:: bash
45
36
 
@@ -22,16 +22,7 @@ Installation
22
22
 
23
23
  pip install numpy
24
24
 
25
- 3. Install newest version of python-mne:
26
-
27
- .. code-block:: bash
28
-
29
- git clone git://github.com/mne-tools/mne-python.git
30
- cd mne-python
31
- python setup.py install
32
-
33
-
34
- 4. Install braindecode via pip:
25
+ 3. Install braindecode via pip:
35
26
 
36
27
  .. code-block:: bash
37
28
 
@@ -33,7 +33,7 @@ class BCICompetition4Set2A(object):
33
33
  mask = np.isnan(data[i_chan])
34
34
  chan_mean = np.nanmean(data[i_chan])
35
35
  data[i_chan, mask] = chan_mean
36
- gdf_events = raw_edf.get_edf_events()
36
+ gdf_events = raw_edf.find_edf_events()
37
37
  raw_edf = mne.io.RawArray(data, raw_edf.info, verbose='WARNING')
38
38
  # remember gdf events
39
39
  raw_edf.info['gdf_events'] = gdf_events
@@ -76,4 +76,4 @@ class BCICompetition4Set2A(object):
76
76
  events[:,0] = trial_events[:,0]
77
77
  events[:,2] = trial_events[:,1]
78
78
 
79
- return events, artifact_trial_mask
79
+ return events, artifact_trial_mask
@@ -162,19 +162,23 @@ class CropsFromTrialsIterator(object):
162
162
  Number of predictions ConvNet makes per one input. Can be computed
163
163
  by making a forward pass with the given input time length, the
164
164
  output length in 3rd dimension is n_preds_per_input.
165
+ seed: int
166
+ Random seed for initialization of `numpy.RandomState`.
165
167
 
166
168
  See Also
167
169
  --------
168
170
  braindecode.experiments.monitors.compute_preds_per_trial_for_set : Assigns predictions to trials, removes overlaps.
169
171
  """
170
- def __init__(self, batch_size, input_time_length, n_preds_per_input):
172
+ def __init__(self, batch_size, input_time_length, n_preds_per_input,
173
+ seed=(2017, 6, 28)):
171
174
  self.batch_size = batch_size
172
175
  self.input_time_length = input_time_length
173
176
  self.n_preds_per_input = n_preds_per_input
174
- self.rng = RandomState((2017, 6, 28))
177
+ self.seed = seed
178
+ self.rng = RandomState(self.seed)
175
179
 
176
180
  def reset_rng(self):
177
- self.rng = RandomState((2017, 6, 28))
181
+ self.rng = RandomState(self.seed)
178
182
 
179
183
  def get_batches(self, dataset, shuffle):
180
184
  # start always at first predictable sample, so
@@ -77,3 +77,30 @@ def split_into_two_sets(dataset, first_set_fraction=None, n_first_set=None):
77
77
  second_set = apply_to_X_y(lambda a: a[n_first_set:], dataset)
78
78
  return first_set, second_set
79
79
 
80
+
81
+ def select_examples(dataset, indices):
82
+ """
83
+ Select examples from dataset.
84
+
85
+ Parameters
86
+ ----------
87
+ dataset: :class:`.SignalAndTarget`
88
+ indices: list of int, 1d-array of int
89
+ Indices to select
90
+
91
+ Returns
92
+ -------
93
+ reduced_set: :class:`.SignalAndTarget`
94
+ Dataset with only examples selected.
95
+ """
96
+ # probably not necessary
97
+ indices = np.array(indices)
98
+ if hasattr(dataset.X, 'ndim'):
99
+ # numpy array
100
+ new_X = np.array(dataset.X)[indices]
101
+ else:
102
+ # list
103
+ new_X = [dataset.X[i] for i in indices]
104
+ new_y = np.asarray(dataset.y)[indices]
105
+ return SignalAndTarget(new_X, new_y)
106
+