Skip to content

Commit 25b9bb6

Browse files
1 parent bd77271 commit 25b9bb6

File tree

144 files changed

+385
-1851
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

144 files changed

+385
-1851
lines changed
Binary file not shown.
Binary file not shown.
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

master/_modules/braindecode/preprocessing/preprocess.html

-68
Original file line numberDiff line numberDiff line change
@@ -414,45 +414,6 @@ <h1>Source code for braindecode.preprocessing.preprocess</h1><div class="highlig
414414
<span class="nb">getattr</span><span class="p">(</span><span class="n">raw_or_epochs</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">fn</span><span class="p">)(</span><span class="o">**</span><span class="bp">self</span><span class="o">.</span><span class="n">kwargs</span><span class="p">)</span></div>
415415

416416

417-
<span class="nd">@deprecated</span><span class="p">(</span><span class="n">extra</span><span class="o">=</span><span class="s1">&#39;will be removed in 0.7.0. Use Preprocessor with &#39;</span>
418-
<span class="s1">&#39;`apply_on_array=False` instead.&#39;</span><span class="p">)</span>
419-
<span class="k">class</span> <span class="nc">MNEPreproc</span><span class="p">(</span><span class="n">Preprocessor</span><span class="p">):</span>
420-
<span class="sd">&quot;&quot;&quot;Preprocessor for an MNE-raw/epoch.</span>
421-
422-
<span class="sd"> Parameters</span>
423-
<span class="sd"> ----------</span>
424-
<span class="sd"> fn: str or callable</span>
425-
<span class="sd"> if str, the raw/epoch object must have a member function with that name.</span>
426-
<span class="sd"> if callable, directly apply the callable to the mne raw/epoch.</span>
427-
<span class="sd"> kwargs:</span>
428-
<span class="sd"> Keyword arguments will be forwarded to the mne function</span>
429-
<span class="sd"> &quot;&quot;&quot;</span>
430-
431-
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">fn</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
432-
<span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="n">fn</span><span class="p">,</span> <span class="n">apply_on_array</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
433-
434-
435-
<span class="nd">@deprecated</span><span class="p">(</span><span class="n">extra</span><span class="o">=</span><span class="s1">&#39;will be removed in 0.7.0. Use Preprocessor with &#39;</span>
436-
<span class="s1">&#39;`apply_on_array=True` instead.&#39;</span><span class="p">)</span>
437-
<span class="k">class</span> <span class="nc">NumpyPreproc</span><span class="p">(</span><span class="n">Preprocessor</span><span class="p">):</span>
438-
<span class="sd">&quot;&quot;&quot;Preprocessor that directly operates on the underlying numpy array of an mne raw/epoch.</span>
439-
440-
<span class="sd"> Parameters</span>
441-
<span class="sd"> ----------</span>
442-
<span class="sd"> fn: callable</span>
443-
<span class="sd"> Function that preprocesses the numpy array</span>
444-
<span class="sd"> channel_wise: bool</span>
445-
<span class="sd"> Whether to apply the function channel-wise.</span>
446-
<span class="sd"> kwargs:</span>
447-
<span class="sd"> Keyword arguments will be forwarded to the function</span>
448-
<span class="sd"> &quot;&quot;&quot;</span>
449-
450-
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">fn</span><span class="p">,</span> <span class="n">channel_wise</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
451-
<span class="k">assert</span> <span class="n">callable</span><span class="p">(</span><span class="n">fn</span><span class="p">),</span> <span class="s1">&#39;fn must be callable.&#39;</span>
452-
<span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="n">fn</span><span class="p">,</span> <span class="n">apply_on_array</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">channel_wise</span><span class="o">=</span><span class="n">channel_wise</span><span class="p">,</span>
453-
<span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
454-
455-
456417
<div class="viewcode-block" id="preprocess"><a class="viewcode-back" href="../../../generated/braindecode.preprocessing.preprocess.html#braindecode.preprocessing.preprocess">[docs]</a><span class="k">def</span> <span class="nf">preprocess</span><span class="p">(</span><span class="n">concat_ds</span><span class="p">,</span> <span class="n">preprocessors</span><span class="p">,</span> <span class="n">save_dir</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">overwrite</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
457418
<span class="n">n_jobs</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
458419
<span class="sd">&quot;&quot;&quot;Apply preprocessors to a concat dataset.</span>
@@ -701,35 +662,6 @@ <h1>Source code for braindecode.preprocessing.preprocess</h1><div class="highlig
701662
<span class="k">return</span> <span class="n">demeaned</span><span class="o">.</span><span class="n">T</span></div>
702663

703664

704-
<div class="viewcode-block" id="zscore"><a class="viewcode-back" href="../../../generated/braindecode.preprocessing.zscore.html#braindecode.preprocessing.zscore">[docs]</a><span class="nd">@deprecated</span><span class="p">(</span><span class="n">extra</span><span class="o">=</span><span class="s1">&#39;will be removed in 0.7.0. Use sklearn.preprocessing.scale &#39;</span>
705-
<span class="s1">&#39;instead.&#39;</span><span class="p">)</span>
706-
<span class="k">def</span> <span class="nf">zscore</span><span class="p">(</span><span class="n">data</span><span class="p">):</span>
707-
<span class="sd">&quot;&quot;&quot;Zscore normalize continuous or windowed data in-place.</span>
708-
709-
<span class="sd"> Parameters</span>
710-
<span class="sd"> ----------</span>
711-
<span class="sd"> data: np.ndarray (n_channels, n_times) or (n_windows, n_channels, n_times)</span>
712-
<span class="sd"> continuous or windowed signal</span>
713-
714-
<span class="sd"> Returns</span>
715-
<span class="sd"> -------</span>
716-
<span class="sd"> zscored: np.ndarray (n_channels x n_times) or (n_windows x n_channels x</span>
717-
<span class="sd"> n_times)</span>
718-
<span class="sd"> normalized continuous or windowed data</span>
719-
720-
<span class="sd"> ..note:</span>
721-
<span class="sd"> If this function is supposed to preprocess continuous data, it should be</span>
722-
<span class="sd"> given to raw.apply_function().</span>
723-
<span class="sd"> &quot;&quot;&quot;</span>
724-
<span class="n">zscored</span> <span class="o">=</span> <span class="n">data</span> <span class="o">-</span> <span class="n">np</span><span class="o">.</span><span class="n">mean</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="n">keepdims</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">axis</span><span class="o">=-</span><span class="mi">1</span><span class="p">)</span>
725-
<span class="n">zscored</span> <span class="o">=</span> <span class="n">zscored</span> <span class="o">/</span> <span class="n">np</span><span class="o">.</span><span class="n">std</span><span class="p">(</span><span class="n">zscored</span><span class="p">,</span> <span class="n">keepdims</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">axis</span><span class="o">=-</span><span class="mi">1</span><span class="p">)</span>
726-
<span class="c1"># TODO: the overriding of protected &#39;_data&#39; should be implemented in the</span>
727-
<span class="c1"># TODO: dataset when transforms are applied to windows</span>
728-
<span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="s1">&#39;_data&#39;</span><span class="p">):</span>
729-
<span class="n">data</span><span class="o">.</span><span class="n">_data</span> <span class="o">=</span> <span class="n">zscored</span>
730-
<span class="k">return</span> <span class="n">zscored</span></div>
731-
732-
733665
<div class="viewcode-block" id="scale"><a class="viewcode-back" href="../../../generated/braindecode.preprocessing.scale.html#braindecode.preprocessing.scale">[docs]</a><span class="nd">@deprecated</span><span class="p">(</span><span class="n">extra</span><span class="o">=</span><span class="s1">&#39;will be removed in 0.7.0. Use numpy.multiply instead.&#39;</span><span class="p">)</span>
734666
<span class="k">def</span> <span class="nf">scale</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="n">factor</span><span class="p">):</span>
735667
<span class="sd">&quot;&quot;&quot;Scale continuous or windowed data in-place</span>

master/api.html

+4-12
Original file line numberDiff line numberDiff line change
@@ -546,11 +546,6 @@
546546
braindecode.preprocessing.exponential_moving_standardize
547547
</a>
548548
</li>
549-
<li class="toctree-l1">
550-
<a class="reference internal" href="generated/braindecode.preprocessing.zscore.html">
551-
braindecode.preprocessing.zscore
552-
</a>
553-
</li>
554549
<li class="toctree-l1">
555550
<a class="reference internal" href="generated/braindecode.preprocessing.scale.html">
556551
braindecode.preprocessing.scale
@@ -1035,19 +1030,16 @@ <h2><a class="toc-backref" href="#id11">Preprocessing</a><a class="headerlink" h
10351030
<tr class="row-odd"><td><p><a class="reference internal" href="generated/braindecode.preprocessing.exponential_moving_standardize.html#braindecode.preprocessing.exponential_moving_standardize" title="braindecode.preprocessing.exponential_moving_standardize"><code class="xref py py-obj docutils literal notranslate"><span class="pre">exponential_moving_standardize</span></code></a>(data[, ...])</p></td>
10361031
<td><p>Perform exponential moving standardization.</p></td>
10371032
</tr>
1038-
<tr class="row-even"><td><p><a class="reference internal" href="generated/braindecode.preprocessing.zscore.html#braindecode.preprocessing.zscore" title="braindecode.preprocessing.zscore"><code class="xref py py-obj docutils literal notranslate"><span class="pre">zscore</span></code></a>(data)</p></td>
1039-
<td><p>DEPRECATED: will be removed in 0.7.0.</p></td>
1040-
</tr>
1041-
<tr class="row-odd"><td><p><a class="reference internal" href="generated/braindecode.preprocessing.scale.html#braindecode.preprocessing.scale" title="braindecode.preprocessing.scale"><code class="xref py py-obj docutils literal notranslate"><span class="pre">scale</span></code></a>(data, factor)</p></td>
1033+
<tr class="row-even"><td><p><a class="reference internal" href="generated/braindecode.preprocessing.scale.html#braindecode.preprocessing.scale" title="braindecode.preprocessing.scale"><code class="xref py py-obj docutils literal notranslate"><span class="pre">scale</span></code></a>(data, factor)</p></td>
10421034
<td><p>DEPRECATED: will be removed in 0.7.0.</p></td>
10431035
</tr>
1044-
<tr class="row-even"><td><p><a class="reference internal" href="generated/braindecode.preprocessing.filterbank.html#braindecode.preprocessing.filterbank" title="braindecode.preprocessing.filterbank"><code class="xref py py-obj docutils literal notranslate"><span class="pre">filterbank</span></code></a>(raw, frequency_bands[, ...])</p></td>
1036+
<tr class="row-odd"><td><p><a class="reference internal" href="generated/braindecode.preprocessing.filterbank.html#braindecode.preprocessing.filterbank" title="braindecode.preprocessing.filterbank"><code class="xref py py-obj docutils literal notranslate"><span class="pre">filterbank</span></code></a>(raw, frequency_bands[, ...])</p></td>
10451037
<td><p>Applies multiple bandpass filters to the signals in raw.</p></td>
10461038
</tr>
1047-
<tr class="row-odd"><td><p><a class="reference internal" href="generated/braindecode.preprocessing.preprocess.html#braindecode.preprocessing.preprocess" title="braindecode.preprocessing.preprocess"><code class="xref py py-obj docutils literal notranslate"><span class="pre">preprocess</span></code></a>(concat_ds, preprocessors[, ...])</p></td>
1039+
<tr class="row-even"><td><p><a class="reference internal" href="generated/braindecode.preprocessing.preprocess.html#braindecode.preprocessing.preprocess" title="braindecode.preprocessing.preprocess"><code class="xref py py-obj docutils literal notranslate"><span class="pre">preprocess</span></code></a>(concat_ds, preprocessors[, ...])</p></td>
10481040
<td><p>Apply preprocessors to a concat dataset.</p></td>
10491041
</tr>
1050-
<tr class="row-even"><td><p><a class="reference internal" href="generated/braindecode.preprocessing.Preprocessor.html#braindecode.preprocessing.Preprocessor" title="braindecode.preprocessing.Preprocessor"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Preprocessor</span></code></a>(fn, *[, apply_on_array])</p></td>
1042+
<tr class="row-odd"><td><p><a class="reference internal" href="generated/braindecode.preprocessing.Preprocessor.html#braindecode.preprocessing.Preprocessor" title="braindecode.preprocessing.Preprocessor"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Preprocessor</span></code></a>(fn, *[, apply_on_array])</p></td>
10511043
<td><p>Preprocessor for an MNE Raw or Epochs object.</p></td>
10521044
</tr>
10531045
</tbody>

master/auto_examples/plot_bcic_iv_2a_moabb_cropped.html

+7-7
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@
465465
<div class="sphx-glr-script-out highlight-none notranslate"><div class="highlight"><pre><span></span>/usr/share/miniconda/envs/braindecode/lib/python3.7/site-packages/sklearn/utils/deprecation.py:87: FutureWarning: Function scale is deprecated; will be removed in 0.7.0. Use numpy.multiply instead.
466466
warnings.warn(msg, category=FutureWarning)
467467

468-
&lt;braindecode.datasets.moabb.MOABBDataset object at 0x7f7d77298390&gt;
468+
&lt;braindecode.datasets.moabb.MOABBDataset object at 0x7f8f1bfa7ed0&gt;
469469
</pre></div>
470470
</div>
471471
<section id="create-model-and-compute-windowing-parameters">
@@ -634,10 +634,10 @@ <h2>Split the dataset<a class="headerlink" href="#split-the-dataset" title="Perm
634634
warnings.warn(warning_msg, SkorchWarning)
635635
epoch train_accuracy train_loss valid_accuracy valid_loss lr dur
636636
------- ---------------- ------------ ---------------- ------------ ------ -------
637-
1 0.2500 1.4486 0.2500 5.4385 0.0006 16.8113
638-
2 0.2569 1.2315 0.2500 3.6823 0.0005 16.5741
639-
3 0.3958 1.1476 0.3611 2.2702 0.0002 16.5465
640-
4 0.4340 1.1225 0.4410 1.4375 0.0000 16.5769
637+
1 0.2500 1.4486 0.2500 5.4386 0.0006 20.5234
638+
2 0.2569 1.2315 0.2500 3.6824 0.0005 19.9409
639+
3 0.3958 1.1476 0.3611 2.2702 0.0002 19.8328
640+
4 0.4340 1.1225 0.4410 1.4375 0.0000 19.7846
641641

642642
&lt;class &#39;braindecode.classifier.EEGClassifier&#39;&gt;[initialized](
643643
module_=ShallowFBCSPNet(
@@ -734,8 +734,8 @@ <h2>Plot Confusion Matrix<a class="headerlink" href="#plot-confusion-matrix" tit
734734
<img src="../_images/sphx_glr_plot_bcic_iv_2a_moabb_cropped_002.png" srcset="../_images/sphx_glr_plot_bcic_iv_2a_moabb_cropped_002.png" alt="plot bcic iv 2a moabb cropped" class = "sphx-glr-single-img"/><div class="sphx-glr-script-out highlight-none notranslate"><div class="highlight"><pre><span></span>&lt;Figure size 800x550 with 1 Axes&gt;
735735
</pre></div>
736736
</div>
737-
<p class="sphx-glr-timing"><strong>Total running time of the script:</strong> ( 1 minutes 33.969 seconds)</p>
738-
<p><strong>Estimated memory usage:</strong> 1195 MB</p>
737+
<p class="sphx-glr-timing"><strong>Total running time of the script:</strong> ( 1 minutes 52.548 seconds)</p>
738+
<p><strong>Estimated memory usage:</strong> 991 MB</p>
739739
<div class="sphx-glr-footer sphx-glr-footer-example docutils container" id="sphx-glr-download-auto-examples-plot-bcic-iv-2a-moabb-cropped-py">
740740
<div class="sphx-glr-download sphx-glr-download-python docutils container">
741741
<p><a class="reference download internal" download="" href="../_downloads/995f58ef1b3d29dce64caee24e5bf457/plot_bcic_iv_2a_moabb_cropped.py"><code class="xref download docutils literal notranslate"><span class="pre">Download</span> <span class="pre">Python</span> <span class="pre">source</span> <span class="pre">code:</span> <span class="pre">plot_bcic_iv_2a_moabb_cropped.py</span></code></a></p>

master/auto_examples/plot_bcic_iv_2a_moabb_trial.html

+7-7
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ <h3>Preprocessing<a class="headerlink" href="#preprocessing" title="Permalink to
435435
<div class="sphx-glr-script-out highlight-none notranslate"><div class="highlight"><pre><span></span>/usr/share/miniconda/envs/braindecode/lib/python3.7/site-packages/sklearn/utils/deprecation.py:87: FutureWarning: Function scale is deprecated; will be removed in 0.7.0. Use numpy.multiply instead.
436436
warnings.warn(msg, category=FutureWarning)
437437

438-
&lt;braindecode.datasets.moabb.MOABBDataset object at 0x7f7d53f94d50&gt;
438+
&lt;braindecode.datasets.moabb.MOABBDataset object at 0x7f8f36ce8f50&gt;
439439
</pre></div>
440440
</div>
441441
</section>
@@ -568,10 +568,10 @@ <h2>Training<a class="headerlink" href="#training" title="Permalink to this head
568568
</div>
569569
<div class="sphx-glr-script-out highlight-none notranslate"><div class="highlight"><pre><span></span> epoch train_accuracy train_loss valid_accuracy valid_loss lr dur
570570
------- ---------------- ------------ ---------------- ------------ ------ ------
571-
1 0.2604 1.6159 0.2465 5.6120 0.0006 6.4000
572-
2 0.2535 1.2103 0.2535 6.3209 0.0005 6.2357
573-
3 0.2535 1.0746 0.2535 5.2375 0.0002 6.4500
574-
4 0.2674 1.0589 0.2535 3.9899 0.0000 6.4442
571+
1 0.2604 1.6159 0.2465 5.6117 0.0006 8.1866
572+
2 0.2535 1.2103 0.2535 6.3208 0.0005 8.1967
573+
3 0.2535 1.0746 0.2535 5.2375 0.0002 8.3569
574+
4 0.2674 1.0589 0.2535 3.9899 0.0000 8.2435
575575

576576
&lt;class &#39;braindecode.classifier.EEGClassifier&#39;&gt;[initialized](
577577
module_=ShallowFBCSPNet(
@@ -662,8 +662,8 @@ <h2>Plot Confusion Matrix<a class="headerlink" href="#plot-confusion-matrix" tit
662662
<img src="../_images/sphx_glr_plot_bcic_iv_2a_moabb_trial_002.png" srcset="../_images/sphx_glr_plot_bcic_iv_2a_moabb_trial_002.png" alt="plot bcic iv 2a moabb trial" class = "sphx-glr-single-img"/><div class="sphx-glr-script-out highlight-none notranslate"><div class="highlight"><pre><span></span>&lt;Figure size 800x550 with 1 Axes&gt;
663663
</pre></div>
664664
</div>
665-
<p class="sphx-glr-timing"><strong>Total running time of the script:</strong> ( 0 minutes 40.226 seconds)</p>
666-
<p><strong>Estimated memory usage:</strong> 1080 MB</p>
665+
<p class="sphx-glr-timing"><strong>Total running time of the script:</strong> ( 0 minutes 50.477 seconds)</p>
666+
<p><strong>Estimated memory usage:</strong> 789 MB</p>
667667
<div class="sphx-glr-footer sphx-glr-footer-example docutils container" id="sphx-glr-download-auto-examples-plot-bcic-iv-2a-moabb-trial-py">
668668
<div class="sphx-glr-download sphx-glr-download-python docutils container">
669669
<p><a class="reference download internal" download="" href="../_downloads/475edf2d5ed60b15717de3100f3551a5/plot_bcic_iv_2a_moabb_trial.py"><code class="xref download docutils literal notranslate"><span class="pre">Download</span> <span class="pre">Python</span> <span class="pre">source</span> <span class="pre">code:</span> <span class="pre">plot_bcic_iv_2a_moabb_trial.py</span></code></a></p>

0 commit comments

Comments
 (0)