Main content

Home

Menu

Loading wiki pages...

View
Wiki Version:
# Energy efficient predictive coding networks ### Description Supplementary material for 'Predictive coding is a consequence of energy efficiency in recurrent neural networks' ### Dependencies 1. Numpy 2. Matplotlib 2. PyTorch 1.5.0 3. Python >= 3.7 4. [bootstrapped](https://pypi.org/project/bootstrapped/) ### Usage Notes: If you want to train your own models you can run train_models.py to produce the model instances used in determining the model preactivations: ```python train_models.py``` The script will automatically run on a gpu if a gpu is available and cuda is set up. Otherwise the script will revert back to cpu. If multiple gpu nodes are available, you can select which node you want the script to run on by prepending CUDA_VISIBLE_DEVICES, i.e: ```CUDA_VISIBLE_DEVICES=GPU_ID python train_models.py``` - If you want to run replicate the analyses please run the fig*.py scripts to produce the main figures in the paper and supplement.py to produce the supplemental results. ### Data Sets We use the MNIST database of handwritten digits and CIFAR10, a labelled subset of the tiny image database . We created wrappers (mnist.py, cifar.py) that loads and transforms the images into sequences in ascending class order (with wraparound from class 9 to class 0). The sequenced data set is used as data for the networks. The appropriate training and test data can be created by simply calling: ```import mnist``` ```training_set, validation_set, test_set = mnist.load(val_ratio=0.0)``` for MNIST and: ```import cifar``` ```training_set, validation_set, test_set = mnist.load(val_ratio=0.0, color=True)``` for CIFAR10. The (batches of) sequences can then be generated by: ``` batches, labels = dataset.create_batches(batch_size=batch_size, sequence_length=sequence_length, shuffle=True)``` Where 'dataset denotes training_set, validation_set or test_set'. ### Usage Conditions If you use this code in your work, we ask you to please cite: Ali, A., Ahmad N., de Groot E., van Gerven M.A.J., Kietzmann T.C. (2021). **Predictive coding is a consequence of energy efficiency in recurrent neural networks.** doi: https://doi.org/10.1101/2021.02.16.430904
OSF does not support the use of Internet Explorer. For optimal performance, please switch to another browser.
Accept
This website relies on cookies to help provide a better user experience. By clicking Accept or continuing to use the site, you agree. For more information, see our Privacy Policy and information on cookie use.
Accept
×

Start managing your projects on the OSF today.

Free and easy to use, the Open Science Framework supports the entire research lifecycle: planning, execution, reporting, archiving, and discovery.