Code for "Natural image synthesis for the retina with variational information bottleneck representation".
- Tensorflow v2.3.0
- Tensorflow-probability 0.11
- Numpy, imageio, matplotlib, shutil, sklearn
Our custom scripts have been executed on an NVIDIA RTX 3090 GPU.
- Change the directory to the path of the codes where
main.py
exists. - To run the code on a trained model, make sure the
models
folder is downloaded and placed in the same directory asmain.py
. Thedata
folder should be one level higher thanmain.py
directory.
Enter the following commands in the command prompt:
python main.py --task test_forward # to see the spiking predictions of the IB-GP model on the Natural dataset
python main.py --task traversal # to run the traversal on the IB-GP model
python main.py --task train_forward # to train the IB-GP/ IB-Disjoint model
python main.py --task adaptive_train # to train the image synthesizer
python main.py --task latent_analyze # to visualize the autocorrelation of the latents and neural dynamics for IB-GP model
The parameters of the network, such as the beta value, the number of training epochs, and the latent dimension, can be changed by:
python main.py --task train_forward --num_epochs 1 --beta 10 --latent_dims 15
The model type can be set by:
--model_type IB-GP (default) or IB-Disjoint
Note: The beta value should be inverted. For example, for a beta value of 0.05, set the beta to 20.
If you use this code, please cite the following paper:
@article{rahmani2022natural,
title={Natural image synthesis for the retina with variational information bottleneck representation},
author={Rahmani, Babak and Psaltis, Demetri and Moser, Christophe},
journal={Advances in Neural Information Processing Systems},
volume={35},
pages={6034--6046},
year={2022}
}