Skip to content

Commit

Permalink
Updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
chadcwilliams committed May 2, 2023
1 parent 08a3592 commit 60d6fe5
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 10 deletions.
57 changes: 52 additions & 5 deletions docs/HowToUse/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,69 @@
hide:
-toc
---
# Install
# Installing EEG-GAN

## <b>Pre-Requisites</b>

The only prerequisites for installing EEG-GAN is [Python](https://www.python.org/downloads/).

---

To install using [pip](https://pip.pypa.io/en/stable/cli/pip_download/):
## <b>Install With Pip</b>

To install using [pip](https://pip.pypa.io/en/stable/cli/pip_download/):<br>

&emsp;&emsp;```pip install eeggan```

You can then import the package functions directly:

&emsp;&emsp;<i>Import functions:</i> ```from eeggan import train_gan, visualize_gan, generate_samples```<br>
&emsp;&emsp;<i>Use function:</i> ```train_gan(argv)```

Or indirectly:

&emsp;&emsp;<i>Import package:</i> ```import eeggan as eg```<br>
&emsp;&emsp;<i>Use function:</i> ```eg.train_gan(argv)```

<i>If you prefer, follow this [link](https://pypi.org/project/eeggan/){.new_tab} to our PyPI page to directly download wheels or source.</i>

---

## <b>Installing From the Source</b>
You can install the latest GitHub version of EEG-GAN into your environment:<br>

&emsp;&emsp;```pip install git+https://github.com/AutoResearch/EEG-GAN@3-release-as-pip-package```

<i>Note that our pip release is currently on the branch 3-release-as-pip-package.</i><br>
<i>Note that the GitHub repo may be ahead of the latest pip release.</i><br>
<i>For most stable results, we suggest you follow the Install With Pip instructions above.</i>

---

You can then import the package functions:
## <b>Obtaining the Source</b>
If you rather download the package via GitHub you can use the following command:<br>

&emsp;&emsp;```from eeggan import train_gan, visualize_gan, generate_samples```
&emsp;&emsp;```git clone https://github.com/AutoResearch/EEG-GAN.git```

To update your local package:

&emsp;&emsp;```git pull```

<i>Note that the GitHub repo may be ahead of the latest pip release.</i> <br>
<i>For most stable results, we suggest you follow the Install With Pip instructions above.</i>

---

You can also find the repository on our [GitHub](https://github.com/AutoResearch/EEG-GAN).
## <b>Dependencies</b>
The following are the required dependencies for EEG-GAN. If you install EEG-GAN via pip, or installed EEG-GAN from the source, these are automatically installed. If you have obtained the package from the source you can install these via the requirements.txt file ```pip install -r requirements.txt``` or via the pyproject.toml file ```pip install -e .[dev]```

&emsp;&emsp;[Pandas](https://pandas.pydata.org/)~=1.3.4<br>
&emsp;&emsp;[NumPy](https://numpy.org/)~=1.21.4<br>
&emsp;&emsp;[Matplotlib](https://matplotlib.org/)~=3.5.0<br>
&emsp;&emsp;[SciPy](https://scipy.org/)~=1.8.0<br>
&emsp;&emsp;[Torch](https://pytorch.org/)~=1.12.1<br>
&emsp;&emsp;[TorchVision](https://pytorch.org/)~=0.13.1<br>
&emsp;&emsp;[TorchSummary](https://pytorch.org/)~=1.5.1<br>
&emsp;&emsp;[TorchAudio](https://pytorch.org/)~=0.12.1<br>
&emsp;&emsp;[Einops](https://github.com/arogozhnikov/einops)~=0.4.1<br>
&emsp;&emsp;[Scikit-Learn](https://scikit-learn.org/)~=1.1.2<br>
4 changes: 2 additions & 2 deletions docs/Research/cognitivescience2023.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ hide:
## <b>Augmenting EEG with Generative Adversarial Networks Enhances Brain Decoding Across Classifiers and Sample Sizes</b>
### <i>Williams, Weinhardt, Wirzberger, & Musslick (in press), Cognitive Science</i>

<center> [Preprint](https://osf.io){ .md-button } [Journal Print](https://cognitivesciencesociety.org/cognitive-science-journal/){ .md-button} [GitHub](https://github.com/chadcwilliams/EEG-GAN_CognitiveScience2023){ .md-button } </center>
<center> [Preprint](https://osf.io){ .md-button } [Journal Print](https://cognitivesciencesociety.org/cognitive-science-journal/){ .md-button} [Data and Scripts](https://github.com/chadcwilliams/EEG-GAN_CognitiveScience2023){ .md-button } </center>

#### <i>Abstract:</i> ####

There is major potential for using electroencephalography (EEG) in brain decoding that has been untapped due to the need for large amounts of data. Advances in machine learning have mitigated this need through data augmentation techniques, such as Generative Adversarial Networks (GANs). Here, we gauged the extent to which GANs can augment EEG data to enhance classification performance. Our objectives were to determine which classifiers benefit from GANaugmented
There is major potential for using electroencephalography (EEG) in brain decoding that has been untapped due to the need for large amounts of data. Advances in machine learning have mitigated this need through data augmentation techniques, such as Generative Adversarial Networks (GANs). Here, we gauged the extent to which GANs can augment EEG data to enhance classification performance. Our objectives were to determine which classifiers benefit from GAN-augmented
EEG and to estimate the impact of sample sizes on GAN-enhancements. We investigated three classifiers—neural networks, support vector machines, and logistic regressions—
across seven sample sizes ranging from 5 to 100 participants. GAN-augmented EEG enhanced classification for neural networks and support vector machines, but not logistic regressions. Further, GAN-enhancements diminished as sample sizes increased—suggesting it is most effective with small samples, which may facilitate research that is unable to collect large amounts of data.

Expand Down
5 changes: 3 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ We here use Generative Adversarial Networks (GANs) to create trial-level synthet

GANs are machine learning frameworks that consist of two adversarial neural network agents, namely the generator and the discriminator. The generator is trained to create novel samples that are indiscernible from real samples. In the current context, the generator produces realistic continuous EEG activity, conditioned on a set of experimental variables, which contain underlying neural features representative of the outcomes being classified. For example, depression manifests as increased alpha oscillatory activity in the EEG signal, and thus, an ideal generator would produce continuous EEG that includes these alpha signatures. In contrast to the generator, the discriminator determines whether a given sample is real or synthetically produced by the generator. The core insight of GANs is that the generator can effectively learn from the discriminator. Specifically, the generator will consecutively produce more realistic synthetic samples with the goal of “fooling” the discriminator into believing them as real. Once it has achieved realistic samples that the discriminator cannot discern, it can be used to generate synthetic data—or in this context, synthetic EEG data.

## <b>Evaluation of the GAN Package</b>
## <b>Evaluation of the EEG-GAN Package</b>
<b>Augmenting EEG with Generative Adversarial Networks Enhances Brain Decoding Across Classifiers and Sample Sizes</b><br>
&emsp;*Williams, Weinhardt, Wirzberger, & Musslick (*submitted, 2023*)*<br>
&emsp;*Williams, Weinhardt, Wirzberger, & Musslick (*in press*), Cognitive Science*<br>
<center>[Williams, Weinhardt, Wirzberger, & Musslick *(in press, Cognitive Science)*](Research/cognitivescience2023.md){ .md-button }</center>

## <b>About</b>

Expand Down
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
site_name: EEG-GANs
site_name: EEG-GAN

theme:
name: material
Expand Down

0 comments on commit 60d6fe5

Please sign in to comment.