Intended directory structure:
├── Code-for-Ying-et-al.-2023
| ├── extracted_all: experimental data converted into python-readable format.
| ├── Figure_1
| ├── Figure_2
| └── ...
└── grid_disruption: this directory
- Make sure MATLAB is installed (preferably 2021b).
- Clone
Code-for-Ying-et-al.-2023repository and placedata_converter_all.minside theFigure_2directory. - Clone CMBHOME directly under the main directory (
Code-for-Ying-et-al.-2023). - Launch MATLAB and run the following commands from inside
Figure_2to convert the data to python-readable format.
addpath ../session_data
addpath ../session_data2
addpath ../CMBHOME
import CMBHOME.*
data_converter_all
Run ying2023_ratemap.py to calculate the ratemaps as well as different metrics (example shell script: ying2023_ratemap.sh).
The results are stored inside the data directory.
analysis_method.ipynb: Figures to help explain the method
analysis_heatmap.ipynb: Heatmap
analysis_ecdf.ipynb: Empirical Cumulative Distributions
Run classifier.py to train a convolutional neural network.
analysis_cnn.ipynb produces corresponding figures.
- Train the RNN by running
main.py(example shell script:run.sh). - Run
eval.pyto perform perturbations (example shell script:eval.sh). analysis_rnn.ipynbproduces corresponding figures.