- Create the Environment
- Activate the Environment
- Train the Network
- Steps to Train the Network
- Training Results
- Optional
- Change Directory
cd neuroscience_lab_meg - On Unix/Linux
conda env create -f environment_ubuntu.yml
- On Mac
conda env create -f environment_mac.yml
Activate the environment using:
conda activate neuroscience_lab- To train a Fully Connected Network, use the file:
fully_connected_single_subject_classifier.py
- To train a 1D Convolution Network, use the file:
conv1d_single_subject_classifier.py
-
Change to the
codeDirectorycd code -
Edit the Training File Edit either
fully_connected_single_subject_classifier.pyorconv1d_single_subject_classifier.py, depending on the network choice. -
Specify the Location of
basedirbasediris the directory where training statistics and results (e.g., TensorBoard logs, figures, and final results) will be saved.- Important: Ensure
basediris empty before starting the training process.
-
Specify the Location of
data_directorydata_directoryis the directory where MEG data (*.fiffiles) are stored.
-
Run the Training Script
- Replace
your_network_filename.pywith the appropriate file name (e.g.,fully_connected_single_subject_classifier.pyorconv1d_single_subject_classifier.py):python your_network_filename.py
- To store logs during the training process:
python your_network_filename.py > training_stdout.txt
- Replace
- Subject-wise training statistics and results will be stored in the
basedirlocation.
To extract and save only the desired channels from MNE files (to save time during training):
python save_selected_channels.py --input_directory /path/to/input --output_directory /path/to/output --channels "A196,A197"