Repository for experiments with the temporal predictive coding model
This repository contains code to perform experiments with temporal predictive coding models.
To run the code, you should first install Anaconda or Miniconda (preferably the latter), and then clone this repository to your local machine.
Once these are installed and cloned, you can use the appropriate .yml
file to create a conda environment.
For Ubuntu or Mac OS, open a terminal (for Windows, open the Anaconda Prompt), go to the directory where you cloned the repo and then enter:
cd temporal-predictive-coding
conda env create -f environment.yml
conda activate temporalenv
pip install -e .
Once the above are done, you can reproduce figures from the paper:
For Figure 3 enter:
python scripts/tracking_inf_steps.py
(panel A, B, C) and
python scripts/tracking_inf_multi_seeds.py
(panel D)
For Figure 4 enter:
python scripts/tracking_learning_AC.py
For Figure 5 enter:
python scripts/tracking_learning_precision.py
For Figure 6 enter (the patches of natural movie data are stored in nat_data
, you should run this script with argument datapath='natdata'
):
python scripts/strf.py
For Figure 7 enter:
python scripts/experiment_fig6.py
Once you run these commands, a directory named results
will be created to store all the data and figures collected from the experiments.