braindecode 0.1.6.2__tar.gz → 0.1.6.4__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 (66) hide show
  1. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/Braindecode.egg-info/PKG-INFO +1 -1
  2. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/Braindecode.egg-info/SOURCES.txt +4 -0
  3. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/PKG-INFO +1 -1
  4. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/braindecode/models/eegnet.py +9 -6
  5. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/braindecode/models/shallow_fbcsp.py +3 -3
  6. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/braindecode/torch_ext/util.py +3 -0
  7. Braindecode-0.1.6.4/braindecode/visualization/__init__.py +0 -0
  8. Braindecode-0.1.6.4/braindecode/visualization/perturbation.py +92 -0
  9. Braindecode-0.1.6.4/braindecode/visualization/plot.py +175 -0
  10. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/docs/source/braindecode.rst +1 -0
  11. Braindecode-0.1.6.4/docs/source/braindecode.visualization.rst +28 -0
  12. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/setup.py +1 -1
  13. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/Braindecode.egg-info/dependency_links.txt +0 -0
  14. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/Braindecode.egg-info/not-zip-safe +0 -0
  15. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/Braindecode.egg-info/requires.txt +0 -0
  16. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/Braindecode.egg-info/top_level.txt +0 -0
  17. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/LICENSE.txt +0 -0
  18. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/MANIFEST.in +0 -0
  19. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/README.rst +0 -0
  20. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/braindecode/__init__.py +0 -0
  21. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/braindecode/datasets/__init__.py +0 -0
  22. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/braindecode/datasets/bbci.py +0 -0
  23. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/braindecode/datasets/bcic_iv_2a.py +0 -0
  24. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/braindecode/datasets/multiple.py +0 -0
  25. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/braindecode/datasets/sensor_positions.py +0 -0
  26. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/braindecode/datautil/__init__.py +0 -0
  27. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/braindecode/datautil/iterators.py +0 -0
  28. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/braindecode/datautil/signal_target.py +0 -0
  29. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/braindecode/datautil/signalproc.py +0 -0
  30. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/braindecode/datautil/splitters.py +0 -0
  31. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/braindecode/datautil/trial_segment.py +0 -0
  32. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/braindecode/datautil/util.py +0 -0
  33. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/braindecode/experiments/__init__.py +0 -0
  34. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/braindecode/experiments/experiment.py +0 -0
  35. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/braindecode/experiments/monitors.py +0 -0
  36. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/braindecode/experiments/stopcriteria.py +0 -0
  37. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/braindecode/mne_ext/__init__.py +0 -0
  38. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/braindecode/mne_ext/signalproc.py +0 -0
  39. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/braindecode/models/__init__.py +0 -0
  40. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/braindecode/models/deep4.py +0 -0
  41. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/braindecode/models/util.py +0 -0
  42. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/braindecode/torch_ext/__init__.py +0 -0
  43. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/braindecode/torch_ext/constraints.py +0 -0
  44. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/braindecode/torch_ext/functions.py +0 -0
  45. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/braindecode/torch_ext/init.py +0 -0
  46. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/braindecode/torch_ext/losses.py +0 -0
  47. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/braindecode/torch_ext/modules.py +0 -0
  48. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/braindecode/util.py +0 -0
  49. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/docs/Makefile +0 -0
  50. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/docs/conf.py +0 -0
  51. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/docs/index.rst +0 -0
  52. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/docs/notebooks/BBCI_Data.ipynb +0 -0
  53. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/docs/notebooks/BBCI_Data_Start_Stop.ipynb +0 -0
  54. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/docs/notebooks/BBCI_Data_Trialwise.ipynb +0 -0
  55. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/docs/notebooks/Cropped_Decoding.ipynb +0 -0
  56. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/docs/notebooks/Experiment_Class.ipynb +0 -0
  57. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/docs/notebooks/TrialWise_Decoding.ipynb +0 -0
  58. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/docs/notebooks/visualization/Perturbation.ipynb +0 -0
  59. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/docs/source/braindecode.datasets.rst +0 -0
  60. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/docs/source/braindecode.datautil.rst +0 -0
  61. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/docs/source/braindecode.experiments.rst +0 -0
  62. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/docs/source/braindecode.mne_ext.rst +0 -0
  63. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/docs/source/braindecode.models.rst +0 -0
  64. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/docs/source/braindecode.torch_ext.rst +0 -0
  65. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/docs/source/modules.rst +0 -0
  66. {Braindecode-0.1.6.2 → Braindecode-0.1.6.4}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.1
2
2
  Name: Braindecode
3
- Version: 0.1.6.2
3
+ Version: 0.1.6.4
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
@@ -40,6 +40,9 @@ braindecode/torch_ext/init.py
40
40
  braindecode/torch_ext/losses.py
41
41
  braindecode/torch_ext/modules.py
42
42
  braindecode/torch_ext/util.py
43
+ braindecode/visualization/__init__.py
44
+ braindecode/visualization/perturbation.py
45
+ braindecode/visualization/plot.py
43
46
  docs/Makefile
44
47
  docs/conf.py
45
48
  docs/index.rst
@@ -57,4 +60,5 @@ docs/source/braindecode.mne_ext.rst
57
60
  docs/source/braindecode.models.rst
58
61
  docs/source/braindecode.rst
59
62
  docs/source/braindecode.torch_ext.rst
63
+ docs/source/braindecode.visualization.rst
60
64
  docs/source/modules.rst
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.1
2
2
  Name: Braindecode
3
- Version: 0.1.6.2
3
+ Version: 0.1.6.4
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
@@ -48,7 +48,7 @@ class EEGNet(object):
48
48
  model.add_module('conv_1', nn.Conv2d(
49
49
  self.in_chans, n_filters_1, (1, 1), stride=1, bias=True))
50
50
  model.add_module('bnorm_1', nn.BatchNorm2d(
51
- n_filters_1, momentum=0.1, affine=True),)
51
+ n_filters_1, momentum=0.01, affine=True, eps=1e-3),)
52
52
  model.add_module('elu_1', Expression(elu))
53
53
  # transpose to examples x 1 x (virtual, not EEG) channels x time
54
54
  model.add_module('permute_1', Expression(lambda x: x.permute(0,3,1,2)))
@@ -57,12 +57,15 @@ class EEGNet(object):
57
57
 
58
58
  n_filters_2 = 4
59
59
  # not clear to me how they did the padding
60
+ # keras padds unequal padding more in front:
61
+ # https://stackoverflow.com/questions/43994604/padding-with-even-kernel-size-in-a-convolutional-layer-in-keras-theano
62
+
60
63
  model.add_module('conv_2', nn.Conv2d(
61
64
  1, n_filters_2, self.second_kernel_size, stride=1,
62
- padding=(self.second_kernel_size[0] // 2, 0),
65
+ padding=(self.second_kernel_size[0] // 2, self.second_kernel_size[1] // 2),
63
66
  bias=True))
64
67
  model.add_module('bnorm_2',nn.BatchNorm2d(
65
- n_filters_2, momentum=0.1, affine=True),)
68
+ n_filters_2, momentum=0.01, affine=True, eps=1e-3),)
66
69
  model.add_module('elu_2', Expression(elu))
67
70
  model.add_module('pool_2', pool_class(
68
71
  kernel_size=(2, 4), stride=(2, 4)))
@@ -71,10 +74,10 @@ class EEGNet(object):
71
74
  n_filters_3 = 4
72
75
  model.add_module('conv_3', nn.Conv2d(
73
76
  n_filters_2, n_filters_3, self.third_kernel_size, stride=1,
74
- padding=(self.third_kernel_size[0] // 2, 0),
77
+ padding=(self.third_kernel_size[0] // 2, self.third_kernel_size[1] // 2),
75
78
  bias=True))
76
79
  model.add_module('bnorm_3',nn.BatchNorm2d(
77
- n_filters_3, momentum=0.1, affine=True),)
80
+ n_filters_3, momentum=0.01, affine=True, eps=1e-3),)
78
81
  model.add_module('elu_3', Expression(elu))
79
82
  model.add_module('pool_3', pool_class(
80
83
  kernel_size=(2, 4), stride=(2, 4)))
@@ -108,4 +111,4 @@ class EEGNet(object):
108
111
  return x
109
112
  model.add_module('squeeze', Expression(squeeze_output))
110
113
  glorot_weight_zero_bias(model)
111
- return model
114
+ return model
@@ -103,9 +103,9 @@ class ShallowFBCSPNet(object):
103
103
  init.xavier_uniform(model.conv_spat.weight, gain=1)
104
104
  if not self.batch_norm:
105
105
  init.constant(model.conv_spat.bias, 0)
106
- else:
107
- init.constant(model.bnorm.weight, 1)
108
- init.constant(model.bnorm.bias, 0)
106
+ if self.batch_norm:
107
+ init.constant(model.bnorm.weight, 1)
108
+ init.constant(model.bnorm.bias, 0)
109
109
  init.xavier_uniform(model.conv_classifier.weight, gain=1)
110
110
  init.constant(model.conv_classifier.bias, 0)
111
111
 
@@ -8,10 +8,13 @@ def np_to_var(X, requires_grad=False, **var_kwargs):
8
8
  """
9
9
  Convenience function to transform numpy array to `torch.autograd.Variable`.
10
10
 
11
+ Converts `X` to ndarray using asarray if necessary.
12
+
11
13
  Returns
12
14
  -------
13
15
  var: `torch.autograd.Variable`
14
16
  """
17
+ X = np.asarray(X)
15
18
  return Variable(th.from_numpy(X), requires_grad=requires_grad, **var_kwargs)
16
19
 
17
20
 
@@ -0,0 +1,92 @@
1
+ import logging
2
+
3
+ import numpy as np
4
+ from numpy.random import RandomState
5
+
6
+ from braindecode.datautil.iterators import get_balanced_batches
7
+ from braindecode.util import wrap_reshape_apply_fn, corr
8
+
9
+ log = logging.getLogger(__name__)
10
+
11
+
12
+ def gaussian_perturbation(amps, rng):
13
+ perturbation = rng.randn(*amps.shape)
14
+ return perturbation
15
+
16
+
17
+ def compute_amplitude_prediction_correlations(pred_fn, examples, n_iterations,
18
+ perturb_fn=gaussian_perturbation,
19
+ batch_size=30,
20
+ seed=((2017, 7, 10))):
21
+ """
22
+ Perturb input amplitudes and compute correlation between amplitude
23
+ perturbations and prediction changes when pushing perturbed input through
24
+ the prediction function.
25
+
26
+ For more details, see [EEGDeepLearning]_.
27
+
28
+ Parameters
29
+ ----------
30
+ pred_fn: function
31
+ Function accepting an numpy input and returning prediction.
32
+ examples: ndarray
33
+ Numpy examples, first axis should be example axis.
34
+ n_iterations: int
35
+ Number of iterations to compute.
36
+ perturb_fn: function, optional
37
+ Function accepting amplitude array and random generator and returning
38
+ perturbation. Default is Gaussian perturbation.
39
+ batch_size: int, optional
40
+ Batch size for computing predictions.
41
+ seed: int, optional
42
+ Random generator seed
43
+
44
+ Returns
45
+ -------
46
+ amplitude_pred_corrs: ndarray
47
+ Correlations between amplitude perturbations and prediction changes
48
+ for all sensors and frequency bins.
49
+ """
50
+ inds_per_batch = get_balanced_batches(
51
+ n_trials=len(examples), rng=None, shuffle=False, batch_size=batch_size)
52
+ log.info("Compute original predictions...")
53
+ orig_preds = [pred_fn(examples[example_inds])
54
+ for example_inds in inds_per_batch]
55
+ orig_preds_arr = np.concatenate(orig_preds)
56
+ rng = RandomState(seed)
57
+ fft_input = np.fft.rfft(examples, axis=2)
58
+ amps = np.abs(fft_input)
59
+ phases = np.angle(fft_input)
60
+
61
+ amp_pred_corrs = []
62
+ for i_iteration in range(n_iterations):
63
+ log.info("Iteration {:d}...".format(i_iteration))
64
+ log.info("Sample perturbation...")
65
+ perturbation = perturb_fn(amps, rng)
66
+ log.info("Compute new amplitudes...")
67
+ # do not allow perturbation to make amplitudes go below
68
+ # zero
69
+ perturbation = np.maximum(-amps, perturbation)
70
+ new_amps = amps + perturbation
71
+ log.info("Compute new complex inputs...")
72
+ new_complex = amplitude_phase_to_complex(new_amps, phases)
73
+ log.info("Compute new real inputs...")
74
+ new_in = np.fft.irfft(new_complex, axis=2).astype(np.float32)
75
+ log.info("Compute new predictions...")
76
+ new_preds = [pred_fn(new_in[example_inds])
77
+ for example_inds in inds_per_batch]
78
+
79
+ new_preds_arr = np.concatenate(new_preds)
80
+
81
+ diff_preds = new_preds_arr - orig_preds_arr
82
+
83
+ log.info("Compute correlation...")
84
+ amp_pred_corr = wrap_reshape_apply_fn(corr, perturbation[:, :, :, 0],
85
+ diff_preds,
86
+ axis_a=(0,), axis_b=(0))
87
+ amp_pred_corrs.append(amp_pred_corr)
88
+ return amp_pred_corrs
89
+
90
+
91
+ def amplitude_phase_to_complex(amplitude, phase):
92
+ return amplitude * np.cos(phase) + amplitude * np.sin(phase) * 1j
@@ -0,0 +1,175 @@
1
+ # coding=utf-8
2
+ import math
3
+
4
+ import numpy as np
5
+ from scipy import interpolate
6
+ import matplotlib.pyplot as plt
7
+ from matplotlib import patches
8
+ from matplotlib.path import Path
9
+ from matplotlib import cm
10
+
11
+ from braindecode.datasets.sensor_positions import CHANNEL_10_20_APPROX, \
12
+ get_channelpos
13
+
14
+
15
+ def ax_scalp(v, channels,
16
+ ax=None, annotate=False,
17
+ vmin=None, vmax=None, cmap=cm.coolwarm,
18
+ scalp_line_width=1,
19
+ scalp_line_style='solid',
20
+ chan_pos_list=CHANNEL_10_20_APPROX,
21
+ interpolation='bilinear'):
22
+ """Draw a scalp plot.
23
+
24
+ Draws a scalp plot on an existing axes. The method takes an array of
25
+ values and an array of the corresponding channel names. It matches
26
+ the channel names with an channel position list
27
+ to project them correctly on the scalp.
28
+
29
+ Parameters
30
+ ----------
31
+ v : 1d-array of floats
32
+ The values for the channels
33
+ channels : 1d array of strings
34
+ The corresponding channel names for the values in ``v``
35
+ ax : Axes, optional
36
+ The axes to draw the scalp plot on. If not provided, the
37
+ currently activated axes (i.e. ``gca()``) will be taken
38
+ annotate : Boolean, optional
39
+ Draw the channel names next to the channel markers.
40
+ vmin, vmax : float, optional
41
+ The display limits for the values in ``v``. If the data in ``v``
42
+ contains values between -3..3 and ``vmin`` and ``vmax`` are set
43
+ to -1 and 1, all values smaller than -1 and bigger than 1 will
44
+ appear the same as -1 and 1. If not set, the maximum absolute
45
+ value in ``v`` is taken to calculate both values.
46
+ cmap : matplotlib.colors.colormap, optional
47
+ A colormap to define the color transitions.
48
+ scalp_line_width: float
49
+ Line width for outline of scalp
50
+ scalp_line_style: float
51
+ Line style for outline of scalp
52
+ chan_pos_list: iterable of tuples
53
+ First entry should be 'angle' or 'cartesian',
54
+ remaining entries 2-tuples of x and y.
55
+ interpolation: str
56
+
57
+ Returns
58
+ -------
59
+ ax : Axes
60
+ the axes on which the plot was drawn
61
+
62
+ Notes
63
+ -----
64
+ Code adapted from Wyrm [1]_ toolbox https://github.com/bbci/wyrm.
65
+
66
+ References
67
+ ----------
68
+
69
+
70
+ .. [1] Schirrmeister, R. T., Springenberg, J. T., Fiederer, L. D. J.,
71
+ Glasstetter, M., Eggensperger, K., Tangermann, M., ... & Ball, T. (2017).
72
+ Deep learning with convolutional neural networks for EEG decoding and
73
+ visualization.
74
+ arXiv preprint arXiv:1703.05051.
75
+
76
+ """
77
+ if ax is None:
78
+ ax = plt.gca()
79
+ assert len(v) == len(channels), "Should be as many values as channels"
80
+ assert interpolation == 'bilinear' or interpolation == 'nearest'
81
+ if vmin is None:
82
+ # added by me (robintibor@gmail.com)
83
+ assert vmax is None
84
+ vmin, vmax = -np.max(np.abs(v)), np.max(np.abs(v))
85
+ # what if we have an unknown channel?
86
+ points = [get_channelpos(c, chan_pos_list) for c in channels]
87
+ for c in channels:
88
+ assert get_channelpos(c, chan_pos_list) is not None, (
89
+ "Expect " + c + " to exist in positions")
90
+ z = [v[i] for i in range(len(points))]
91
+ # calculate the interpolation
92
+ x = [i[0] for i in points]
93
+ y = [i[1] for i in points]
94
+ # interpolate the in-between values
95
+ xx = np.linspace(min(x), max(x), 500)
96
+ yy = np.linspace(min(y), max(y), 500)
97
+ if interpolation == 'bilinear':
98
+ xx_grid, yy_grid = np.meshgrid(xx, yy)
99
+ f = interpolate.LinearNDInterpolator(list(zip(x, y)), z)
100
+ zz = f(xx_grid, yy_grid)
101
+ else:
102
+ assert interpolation == 'nearest'
103
+ f = interpolate.NearestNDInterpolator(list(zip(x, y)), z)
104
+ assert len(xx) == len(yy)
105
+ zz = np.ones((len(xx), len(yy)))
106
+ for i_x in xrange(len(xx)):
107
+ for i_y in xrange(len(yy)):
108
+ # somehow this is correct. don't know why :(
109
+ zz[i_y, i_x] = f(xx[i_x], yy[i_y])
110
+ # zz[i_x,i_y] = f(xx[i_x], yy[i_y])
111
+ assert not np.any(np.isnan(zz))
112
+
113
+ # plot map
114
+ image = ax.imshow(zz, vmin=vmin, vmax=vmax, cmap=cmap,
115
+ extent=[min(x), max(x), min(y), max(y)], origin='lower',
116
+ interpolation=interpolation)
117
+ # image = ax.contourf(xx, yy, zz, 100, vmin=vmin, vmax=vmax,
118
+ # cmap=colormap)
119
+ if scalp_line_width > 0:
120
+ # paint the head
121
+ ax.add_artist(plt.Circle((0, 0), 1, linestyle=scalp_line_style,
122
+ linewidth=scalp_line_width, fill=False))
123
+ # add a nose
124
+ ax.plot([-0.1, 0, 0.1], [1, 1.1, 1], color='black',
125
+ linewidth=scalp_line_width, linestyle=scalp_line_style)
126
+ # add ears
127
+ _add_ears(ax, scalp_line_width, scalp_line_style)
128
+ # add markers at channels positions
129
+ # set the axes limits, so the figure is centered on the scalp
130
+ ax.set_ylim([-1.05, 1.15])
131
+ ax.set_xlim([-1.15, 1.15])
132
+
133
+ # hide the frame and ticks
134
+ ax.set_frame_on(False)
135
+ ax.set_xticks([])
136
+ ax.set_yticks([])
137
+ # draw the channel names
138
+ if annotate:
139
+ for i in zip(channels, list(zip(x, y))):
140
+ ax.annotate(" " + i[0], i[1], horizontalalignment="center",
141
+ verticalalignment='center')
142
+ ax.set_aspect(1)
143
+ return image
144
+
145
+
146
+ def _add_ears(ax, linewidth, linestyle):
147
+ start_x = np.cos(10 * np.pi / 180.0)
148
+ start_y = np.sin(10 * np.pi / 180.0)
149
+ end_x = np.cos(-15 * np.pi / 180.0)
150
+ end_y = np.sin(-15 * np.pi / 180.0)
151
+ verts = [
152
+ (start_x, start_y),
153
+ (start_x + 0.05, start_y + 0.05), # out up
154
+ (start_x + 0.1, start_y), # further out, back down
155
+ (start_x + 0.11, (end_y * 0.7 + start_y * 0.3)), # midpoint
156
+ (end_x + 0.14, end_y), # down out start
157
+ (end_x + 0.05, end_y - 0.05), # down out further
158
+ (end_x, end_y), # endpoint
159
+ ]
160
+
161
+ codes = [Path.MOVETO] + [Path.CURVE3] * (len(verts) - 1)
162
+
163
+ path = Path(verts, codes)
164
+
165
+ patch = patches.PathPatch(path, facecolor='none',
166
+ linestyle=linestyle, linewidth=linewidth)
167
+
168
+ ax.add_patch(patch)
169
+ verts_left = [(-x, y) for x, y in verts]
170
+ path_left = Path(verts_left, codes)
171
+
172
+ patch_left = patches.PathPatch(path_left, facecolor='none',
173
+ linestyle=linestyle, linewidth=linewidth)
174
+
175
+ ax.add_patch(patch_left)
@@ -17,6 +17,7 @@ Subpackages
17
17
  braindecode.mne_ext
18
18
  braindecode.models
19
19
  braindecode.torch_ext
20
+ braindecode.visualization
20
21
 
21
22
  Submodules
22
23
  ----------
@@ -0,0 +1,28 @@
1
+ braindecode\.visualization package
2
+ ==================================
3
+
4
+ .. automodule:: braindecode.visualization
5
+ :members:
6
+ :undoc-members:
7
+ :show-inheritance:
8
+
9
+ Submodules
10
+ ----------
11
+
12
+ braindecode\.visualization\.perturbation module
13
+ -----------------------------------------------
14
+
15
+ .. automodule:: braindecode.visualization.perturbation
16
+ :members:
17
+ :undoc-members:
18
+ :show-inheritance:
19
+
20
+ braindecode\.visualization\.plot module
21
+ ---------------------------------------
22
+
23
+ .. automodule:: braindecode.visualization.plot
24
+ :members:
25
+ :undoc-members:
26
+ :show-inheritance:
27
+
28
+
@@ -15,7 +15,7 @@ setup(
15
15
  # Versions should comply with PEP440. For a discussion on single-sourcing
16
16
  # the version across setup.py and the project code, see
17
17
  # http://packaging.python.org/en/latest/tutorial.html#version
18
- version='0.1.6.2', # TODO: read from __init__.py?
18
+ version='0.1.6.4', # TODO: read from __init__.py?
19
19
 
20
20
  description='A deep learning toolbox to decode raw time-domain EEG.',
21
21
  long_description=long_description,
File without changes
File without changes
File without changes
File without changes