All Projects → GMvandeVen → Brain Inspired Replay

GMvandeVen / Brain Inspired Replay

Licence: mit
A brain-inspired version of generative replay for continual learning with deep neural networks (e.g., class-incremental learning on CIFAR-100; PyTorch code).

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Brain Inspired Replay

Continual Learning
PyTorch implementation of various methods for continual learning (XdG, EWC, online EWC, SI, LwF, GR, GR+distill, RtF, ER, A-GEM, iCaRL).
Stars: ✭ 600 (+506.06%)
Mutual labels:  artificial-neural-networks, variational-autoencoder, replay
Deep Learning Drizzle
Drench yourself in Deep Learning, Reinforcement Learning, Machine Learning, Computer Vision, and NLP by learning from these exciting lectures!!
Stars: ✭ 9,717 (+9715.15%)
Mutual labels:  artificial-neural-networks
Applying eanns
A 2D Unity simulation in which cars learn to navigate themselves through different courses. The cars are steered by a feedforward neural network. The weights of the network are trained using a modified genetic algorithm.
Stars: ✭ 1,093 (+1004.04%)
Mutual labels:  artificial-neural-networks
Machine Learning Without Any Libraries
This is a collection of some of the important machine learning algorithms which are implemented with out using any libraries. Libraries such as numpy and pandas are used to improve computational complexity of algorithms
Stars: ✭ 77 (-22.22%)
Mutual labels:  artificial-neural-networks
Codeslam
Implementation of CodeSLAM — Learning a Compact, Optimisable Representation for Dense Visual SLAM paper (https://arxiv.org/pdf/1804.00874.pdf)
Stars: ✭ 64 (-35.35%)
Mutual labels:  variational-autoencoder
Implementation variational Auto Encoder
Simple implementation of Variational Autoencoder
Stars: ✭ 81 (-18.18%)
Mutual labels:  variational-autoencoder
Genann
simple neural network library in ANSI C
Stars: ✭ 1,088 (+998.99%)
Mutual labels:  artificial-neural-networks
Python World
Stars: ✭ 98 (-1.01%)
Mutual labels:  variational-autoencoder
Malware Classification
Towards Building an Intelligent Anti-Malware System: A Deep Learning Approach using Support Vector Machine for Malware Classification
Stars: ✭ 88 (-11.11%)
Mutual labels:  artificial-neural-networks
Bayesian Machine Learning
Notebooks about Bayesian methods for machine learning
Stars: ✭ 1,202 (+1114.14%)
Mutual labels:  variational-autoencoder
Gru Svm
[ICMLC 2018] A Neural Network Architecture Combining Gated Recurrent Unit (GRU) and Support Vector Machine (SVM) for Intrusion Detection
Stars: ✭ 76 (-23.23%)
Mutual labels:  artificial-neural-networks
Pcrc
PyCraft based Replay Client
Stars: ✭ 66 (-33.33%)
Mutual labels:  replay
Pollyjs
Record, Replay, and Stub HTTP Interactions.
Stars: ✭ 9,484 (+9479.8%)
Mutual labels:  replay
Repo 2017
Python codes in Machine Learning, NLP, Deep Learning and Reinforcement Learning with Keras and Theano
Stars: ✭ 1,123 (+1034.34%)
Mutual labels:  variational-autoencoder
Unityreplaysystem
Project demonstrating how to use input logging to create a replay system, where the replay is viewed by replaying the inputs with a deterministic fixed timestep.
Stars: ✭ 92 (-7.07%)
Mutual labels:  replay
Vae protein function
Protein function prediction using a variational autoencoder
Stars: ✭ 57 (-42.42%)
Mutual labels:  variational-autoencoder
Aialpha
Use unsupervised and supervised learning to predict stocks
Stars: ✭ 1,191 (+1103.03%)
Mutual labels:  artificial-neural-networks
Shadowreplay Linux
Shadowplay's Replay Feature On Linux For Nvidia, AMD and Intel
Stars: ✭ 79 (-20.2%)
Mutual labels:  replay
Sigma
Rocket powered machine learning. Create, compare, adapt, improve - artificial intelligence at the speed of thought.
Stars: ✭ 98 (-1.01%)
Mutual labels:  artificial-neural-networks
Neural Api
CAI NEURAL API - Pascal based neural network API optimized for AVX, AVX2 and AVX512 instruction sets plus OpenCL capable devices including AMD, Intel and NVIDIA.
Stars: ✭ 94 (-5.05%)
Mutual labels:  artificial-neural-networks

Brain-Inspired Replay

A PyTorch implementation of the continual learning experiments with deep neural networks described in the following paper:

This paper proposes a new, brain-inspired version of generative replay that can scale to continual learning problems with natural images as inputs. This is demonstrated with the Split CIFAR-100 protocol, both for task-incremental learning and for class-incremental learning.

Installation & requirements

The current version of the code has been tested with Python 3.5.2 on several Linux operating systems with the following versions of PyTorch and Torchvision:

  • pytorch 1.1.0
  • torchvision 0.2.2

The versions that were used for other Python-packages are listed in requirements.txt.

To use the code, download the repository and change into it:

git clone https://github.com/GMvandeVen/brain-inspired-replay.git
cd brain-inspired-replay

(If downloading the zip-file, extract the files and change into the extracted folder.)

Assuming Python and pip are set up, the Python-packages used by this code can be installed using:

pip install -r requirements.txt

However, you might want to install pytorch and torchvision in a slightly different way to ensure compatability with your version of CUDA (see https://pytorch.org/).

Finally, the code in this repository itself does not need to be installed, but a number of scripts should be made executable:

chmod +x main_*.py compare_*.py create_figures.sh

Demos

Demo 1: Brain-inspired replay on split MNIST

./main_cl.py --experiment=splitMNIST --scenario=class --replay=generative --brain-inspired --pdf

This runs a single continual learning experiment: brain-inspired replay on the class-incremental learning scenario of split MNIST. Information about the data, the model, the training progress and the produced outputs (e.g., a pdf with results) is printed to the screen. Expected run-time on a standard laptop is ~12 minutes, with a GPU it should take ~4 minutes.

Demo 2: Comparison of continual learning methods

./compare_MNIST.py --scenario=class

This runs a series of continual learning experiments to compare the performance of various methods. Information about the different experiments, their progress and the produced outputs (e.g., a summary pdf) is printed to the screen. Expected run-time on a standard laptop is ~50 minutes, with a GPU it should take ~18 minutes.

These two demos can also be run with on-the-fly plots using the flag --visdom. For this visdom must be activated first, see instructions below.

Running comparisons from the paper

The script create_figures.sh provides step-by-step instructions for re-running the experiments and re-creating the figures reported in the paper.

Although it is possible to run this script as it is, it will take very long and it is probably sensible to parallellize the experiments.

Running custom experiments

Using main_cl.py, it is possible to run custom individual experiments. The main options for this script are:

  • --experiment: which task protocol? (splitMNIST|permMNIST|CIFAR100)
  • --scenario: according to which scenario? (task|domain|class)
  • --tasks: how many tasks?

To run specific methods, use the following:

  • Context-dependent-Gating (XdG): ./main_cl.py --xdg --xdg-prop=0.8
  • Elastic Weight Consolidation (EWC): ./main_cl.py --ewc --lambda=5000
  • Online EWC: ./main_cl.py --ewc --online --lambda=5000 --gamma=1
  • Synaptic Intelligenc (SI): ./main_cl.py --si --c=0.1
  • Learning without Forgetting (LwF): ./main_cl.py --replay=current --distill
  • Generative Replay (GR): ./main_cl.py --replay=generative
  • Brain-Inspired Replay (BI-R): ./main_cl.py --replay=generative --brain-inspired

For information on further options: ./main_cl.py -h.

PyTorch-implementations for several methods relying on stored data (Experience Replay, iCaRL and A-GEM), as well as for additional metrics (FWT, BWT, forgetting, intransigence), can be found here: https://github.com/GMvandeVen/continual-learning.

On-the-fly plots during training

With this code it is possible to track progress during training with on-the-fly plots. This feature requires visdom. Before running the experiments, the visdom server should be started from the command line:

python -m visdom.server

The visdom server is now alive and can be accessed at http://localhost:8097 in your browser (the plots will appear there). The flag --visdom should then be added when calling ./main_cl.py to run the experiments with on-the-fly plots.

For more information on visdom see https://github.com/facebookresearch/visdom.

Citation

Please consider citing our paper if you use this code in your research:

@article{vandeven2020brain,
  title={Brain-inspired replay for continual learning with artificial neural networks},
  author={van de Ven, Gido M and Siegelmann, Hava T and Tolias, Andreas S},
  journal={Nature Communications},
  volume={11},
  pages={4069},
  year={2020}
}

Acknowledgments

The research project from which this code originated has been supported by an IBRO-ISN Research Fellowship, by the Lifelong Learning Machines (L2M) program of the Defence Advanced Research Projects Agency (DARPA) via contract number HR0011-18-2-0025 and by the Intelligence Advanced Research Projects Activity (IARPA) via Department of Interior/Interior Business Center (DoI/IBC) contract number D16PC00003. Disclaimer: views and conclusions contained herein are those of the authors and should not be interpreted as necessarily representing the official policies or endorsements, either expressed or implied, of DARPA, IARPA, DoI/IBC, or the U.S. Government.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].