Official implementation for the paper:
Hebbian and Gradient-based Plasticity Enables Robust Memory and Rapid Learning in RNNs
Clone the repo:
git clone https://github.com/yuvenduan/PlasticRNNs
cd PlasticRNNs
Install dependencies in a new conda environment:
conda env create -f environment.yml
conda activate plastic
If you are interested in reproducing results on one-shot image classification, download CIFAR-FS and/or miniImageNet. Unzip the datasets and put the files under data/CIFAR_FS
and data/miniImageNet
. Alternatively, you can change the path to the datasets in datasets/fsc/CIFAR_FS.py
and datasets/fsc/mini_imagenet.py
.
As a demo for the cue-reward association task, run:
python main.py -t cuereward_demo
If you have multiple GPUs on your machine, you can add -s
so that experiments could be run concurrently. If you are using a slurm cluster, you can add -c
so that experiments will be submitted to the cluster.
During training, progress can be found in experiments/cuereward_demo/.../progress.txt
. After training, try
python main.py -a cuereward_demo
to plot the training curves. The result is stored as figures/cuereward/curves-demo.pdf
.
Configurations for all experiments in the paper can be found at configs/experiments.py
, whereas the analyses can be found at configs/exp_analysis.py
. These experiments and analyses can be run similarly.
The codebase is based on the code from Meta-Learning with Differentiable Convex Optimization and Evolving the olfactory system with machine learning.