Need help with agem?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

155 Stars 33 Forks MIT License 64 Commits 6 Opened issues


Official implementation of the Averaged Gradient Episodic Memory (A-GEM) in Tensorflow

Services available


Need anything else?

Contributors list

No Data

Efficient Lifelong Learning with A-GEM

This is the official implementation of the Averaged Gradient Episodic Memory (A-GEM) and Experience Replay with Tiny Memories in Tensorflow.


TensorFlow >= v1.9.0.


To replicate the results of the paper on a particular dataset, execute (see the Note below for downloading the CUB and AWA datasets):

$ ./   
Example runs are:
$ ./ MNIST 3      /* Train PNN and A-GEM on MNIST */
$ ./ CUB 1 1      /* Train JE models of RWALK and A-GEM on CUB */


For CUB and AWA experiments, download the dataset prior to running the above script. Run following for downloading the datasets:

$ ./

The plotting code is provided under the folder

. Update the paths in the plotting code accordingly.

Experience Replay

The code provides an implementation of experience replay (ER) with reservoir sampling on MNIST and CIFAR datasets. To run the ER experiments execute the following script:

$ ./

When using this code, please cite our papers:

  title={Efficient Lifelong Learning with A-GEM},
  author={Chaudhry, Arslan and Ranzato, Marc’Aurelio and Rohrbach, Marcus and Elhoseiny, Mohamed},

@article{chaudhryER_2019, title={Continual Learning with Tiny Episodic Memories}, author={Chaudhry, Arslan and Rohrbach, Marcus and Elhoseiny, Mohamed and Ajanthan, Thalaiyasingam and Dokania, Puneet K and Torr, Philip HS and Ranzato, Marc’Aurelio}, journal={arXiv preprint arXiv:1902.10486, 2019}, year={2019} }

@inproceedings{chaudhry2018riemannian, title={Riemannian Walk for Incremental Learning: Understanding Forgetting and Intransigence}, author={Chaudhry, Arslan and Dokania, Puneet K and Ajanthan, Thalaiyasingam and Torr, Philip HS}, booktitle={ECCV}, year={2018} }

Questions/ Bugs

  • For questions, contact the author Arslan Chaudhry ([email protected]).
  • Feel free to open the bugs if anything is broken.


This source code is released under The MIT License found in the LICENSE file in the root directory of this source tree.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.