4.2 Following Along with the EPP Tutorial

Set Up Your HNN Environment

We assume for this walkthrough that you have access to the latest stable version of the hnn-core software. If not, please follow the instructions on our Installation page to step up HNN. We also recommend reading the remainer of this page in full, as there are additional instructions for following along with the ERP walkthrough.

Note that the Installation page includes instructions for running HNN "on the cloud" and for installing HNN locally on your personal machine. While the cloud versions of HNN can be relatively easy to get up and running, they do come with certain limitations (such as limited access to compute cores in the case of Google CoLab). As such, we recommend that you install HNN on your local machine using the conda installation method. However, if you are unable to install HNN locally, using one of the cloud methods is a perfectly viable alternative.

The (recommended) conda installation method will install the latest stable version of hnn-core on your device, including the Graphical User Interface (GUI) and other dependencies for running faster simulations using parallelism (i.e., multuiple processor cores).

Once you have completed the conda installation instructions, you can activate your conda environment with the following Command Line command:

conda activate hnn-core-env

You can then launch the GUI from the active conda environment with the following command:

hnn-gui

Following Along With the Textbook's Python API Tutorials

Note that any code blocks on the subsequent pages of the Simulating ERPs walkthrough are cumulative. That is to say, these code blocks are meant to be run in sequential order, as they are drawn from a single ipython notebook file.

By clicking the Download Notebook button at the top of this page, you can download the entire .ipynb file and run it interactively through Jupyter Notebook or through your preferred code editor (VS Code, Pycharm, etc.).

Keep in mind that your code editor may install additional dependencies needed to open and run .ipynb files when using the hnn-core-env conda environment.

If you would like to launch a Jupyter Notebook server directly from the Command Line, you will need to install Jupyter's notebook dependency directly into hnn-core-env. To do so, run the following command from your active hnn-core-env conda environment:

conda install -c conda-forge notebook

After installation, you can launch the jupyter server with the following command:

jupyter notebook

Alternatively, you can start an interactive ipython environment with the command below. This will allow you to run individual commands from your Command Line interface without needing to install the additional notebook dependency from Jupyter.

ipython

Accessing Data and Network Files

At various points in the tutorials, we will reference particular network and/or data files. These files can be found on our hnn-data GitHub repository

In brief, the MEG_detection_data subdirectory contains the experimental MEG data referenced in our Jones et al. (2007) study, while the network-configurations subdirectory contains various network configuration files for simulating ERPs and rhythms

We recommend that you clone this repository to your local machine, as you will need several of these files to follow along with the tutorials

You can clone this repository with the following command:

git clone https://github.com/jonescompneurolab/hnn-data.git

We will periodically update or add new network configuration files, so we recommend occasionally pulling the latest changes from GitHub. You can do so with the following commands:

git checkout main
git pull origin main