On Tiny Episodic Memories in Continual Learning
Arslan Chaudhry Marcus Rohrbach Mohamed Elhoseiny Thalaiyasingam Ajanthan Puneet K. Dokania Philip H. S. Torr Marc'Aurelio Ranzato


Dispersion of Mobile Robots: The Power of Randomness
    Anisur Rahaman Molla1Research supported in part by DST Inspire Faculty research grant DST/INSPIRE/04/2015/002801. ORCID ID: 0000-0002-1537-3462William K. Moses Jr.2Research supported in part by a grant of his postdoctoral fellowship hosts from the Israeli Ministry of Science. ORCID ID: 0000-0002-4533-7593

    December 30, 2023
=======================================================================================================================================================================================================================================================================================================================













In continual learning (CL), an agent learns from a stream of tasks leveraging prior experience to transfer knowledge to future tasks. It is an ideal framework to decrease the amount of supervision in the existing learning algorithms. But for a successful knowledge transfer, the learner needs to remember how to perform previous tasks. One way to endow the learner the ability to perform tasks seen in the past is to store a small memory, dubbed episodic memory, that stores few examples from previous tasks and then to replay these examples when training for future tasks. In this work, we empirically analyze the effectiveness of a very small episodic memory in a CL setup where each training example is only seen once. Surprisingly, across four rather different supervised learning benchmarks adapted to CL, a very simple baseline, that jointly trains on both examples from the current task as well as examples stored in the episodic memory, significantly outperforms specifically designed CL approaches with and without episodic memory.
Interestingly, we find that repetitive training on even tiny memories of past tasks does not harm generalization, on the contrary, it improves it, with gains between 7% and 17% when the memory is populated with a single example per class.[Code: <https://github.com/facebookresearch/agem>] 


 



§ INTRODUCTION
 
The objective of continual learning (CL) is to rapidly learn new skills from a sequence of tasks leveraging the knowledge accumulated in the past. 
Catastrophic forgetting <cit.>, i.e. the inability of a model to recall how to perform tasks seen in the past, makes such efficient 
adaptation extremely difficult.



This decades old problem of CL <cit.> is now seeing a surge of interest in the research community with several methods proposed to tackle catastrophic forgetting <cit.>. In this work, we quantitatively study some of these methods (that assume a fixed network architecture) on four benchmark datasets under the following assumptions: i) each task is fully supervised, ii) each example from a task can only be seen once using the learning protocol proposed by <cit.> (see §<ref>), and iii) 
the model has access to a small memory storing examples of past tasks. Restricting the size of such episodic memory is important because it makes the continual learning problem more realistic and distinct from multi-task learning where complete datasets of all the tasks are available at each step.  

We empirically observe that a very simple baseline, dubbed Experience Replay (ER)[For consistency to prior work in the literature, we will refer to this approach which trains on the episodic memory as ER, although its usage for supervised learning tasks is far less established.], that jointly trains on both the examples from the current task and examples stored in the very small episodic memory not only gives superior performance over the existing state-of-the-art approaches specifically designed for CL (with and without episodic memory), but it also is computationally very efficient. We verify this finding on four rather different supervised learning benchmarks adapted for CL; Permuted MNIST, Split CIFAR, Split miniImageNet and Split CUB. Importantly, repetitive training on the same examples of a tiny episodic memory does not harm generalization on past tasks. In §<ref>, we analyze this phenomenon and provide insights as to why directly training on the episodic memory does not have a detrimental effect in terms of generalization. Briefly, we observe that the training on the datasets of subsequent tasks acts like a data-dependent regularizer on past tasks allowing the repetitive training on tiny memory to generalize beyond the episodic memory. We further observe that methods, that do not train directly on the memory, such as GEM <cit.> and A-GEM <cit.>, underfit the training data and end up not fully utilizing the beneficial effects of this implicit and data depdendent regularization.






Overall, ER with tiny episodic memories offers very strong performance at a very small additional computational cost over the  fine-tuning baseline. 
We believe that this approach will serve as a stronger baseline for the development of future CL approaches. 





§ RELATED WORK
 


  
Regularization-based CL approaches These works attempt to reduce forgetting by regularizing the objective such that it either penalizes the feature drift on already learned tasks <cit.> or discourages change in parameters that were important to solve past tasks <cit.>. The former approach relies on the storage of network activations and subsequent deployment of knowledge distillation <cit.>, whereas the latter approach stores a measure of parameter importance whose best case memory complexity is the same as the total number of network parameters.



  
Memory-Based CL approaches These approaches <cit.> use episodic memory that stores a subset of data from past tasks to tackle forgetting. One approach to leverage such episodic memory is to use it to constrain the optimization such that the loss on past tasks can never increase <cit.>. 



  
Experience Replay (ER) The use of ER is well established in reinforcement learning (RL) tasks <cit.>. <cit.>, for instance, explore different ways to populate a relatively large episodic memory for a continual RL setting where the learner does multiple passes over the data. In this work instead, we study supervised learning tasks with a single pass through data and a very small episodic memory. More recently, <cit.> used ER for supervised CL learning tasks. <cit.>, independently, study different replay strategies in ER and show improvements over the finetune baseline. Our contribution is to show the improvements brought by ER, perhaps surprisingly, over the specifically designed CL approaches. We differ from <cit.> in considering episodic memories of much smaller sizes. Finally, and most importantly, we extend these previous studies by analyzing why repetitive training on tiny memories does not lead to overfitting (§<ref>).
 












We briefly summarize our contributions below:

    
  * We observe large performance improvements with join training (ER) on tiny episodic memories (1 or 3 samples per class) in a continual learning setup over the best performing CL approaches on four rather different datasets (Fig. <ref>, Tabs. <ref>, <ref>, <ref>, <ref>). To the best of our knowledge, such huge improvements with tiny memories have never been observed before.
    
  * We analyze why repetitive learning on a tiny memory does not harm generalization (§<ref>). 
    
  * We discuss and evaluate memory writing approaches that work best under different memory size regimes. We propose a hybrid approach of memory writing that does not require knowledge of the total number of tasks a priori. 




§ LEARNING FRAMEWORK
 



 §.§ Protocol for Single-Pass Through the Data
 

We use the learning protocol proposed by <cit.>. There are two streams of tasks, described by the following ordered sequences of datasets, one stream for Cross-Validation ^CV = {_-T^CV, ⋯,_-1} consisting of T^CV tasks, and one for EValuation ^EV = {_1, ⋯,_T} consisting of T tasks, where _k = {(_i^k, t_i^k, y_i^k)_i=1^n_k} is the dataset of the k-th task. The sequence ^CV contains only a handful of tasks and it is only used for cross-validation purposes. Tasks from this sequence can be replayed as many times as needed and have various degree of similarity to tasks in the training and evaluation dataset, ^EV. The latter stream, ^EV, instead can be played only once; the learner will observe examples in sequence and will be tested throughout the learning experience. The final performance will be reported on the held-out test set drawn from  ^EV.

The k-th task in any of these streams consists of _k = {(_i^k, t_i^k, y_i^k)_i=1^n_k}, where each triplet 
constitutes an example defined by an input (^k ∈), a task descriptor (t^k ∈) which is an integer id in this work, and a target vector (y^k ∈^k), where ^k is the set of labels specific to task k and ^k ⊂. 




 §.§ Metrics
 
We measure performance on ^EV using two metrics, as standard practice in the literature <cit.>:





  
Average Accuracy (A ∈ [0,1]) Let a_i, j be the performance of the model on the held-out test set of task `j' after the model is trained on task `i'. The average accuracy at task T is then defined as:

    A_T = 1/T∑_j=1^T a_T, j



  
Forgetting (F ∈ [-1,1]) Let f_j^i be the forgetting on task `j' after the model is trained on task `i' which is computed as:

    f_j^i = max_l ∈{1,⋯,i-1} a_l, j - a_i, j

The average forgetting measure at task T is then defined as:

    F_T = 1/T-1∑_j=1^T-1 f_j^T





§ EXPERIENCE REPLAY
 


Recent works <cit.> have shown that methods relying on episodic memory have superior performance than regularization based 
approaches (e.g.,  <cit.>) when using a “single-pass through the data” protocol (§<ref>). 
While GEM <cit.> and its more efficient version A-GEM <cit.> used the episodic memory as a mean to project gradients, here we drastically simplify the optimization problem and, similar to <cit.> and <cit.>, directly train on the the examples stored in a very small memory, resulting in better performance and more efficient learning. 



The overall training procedure is given in Alg. <ref>. Compared to the simplest baseline model that merely fine-tunes the parameters on the new task starting from the 
previous task parameter vector, ER makes two modifications. First, it has an episodic memory which is updated at every time step, . 
Second, it doubles the size of the minibatch used to compute the gradient descent parameter update  by stacking the actual minibatch of examples from the current task
with a minibatch of examples taken at random from the memory, .
As we shall see in our empirical validation, these two simple modifications yield much better generalization and substantially limit forgetting, while incurring in
a negligible additional computational cost on modern GPU devices. Next, we explain the difference between the direct (ER) and indirect (A-GEM) training on episodic memory from the optimization perspective. 



  
A-GEM vs ER: Let us assume that B_n is a mini-batch of size K from the current task t and B_ is the same size mini-batch from a very small episodic memory . Furthermore, following the notation from <cit.>, let g be the gradient computed with mini-batch B_n and g_ref be the gradient computed with B_. In A-GEM, if g^T g_ref≥ 0, then the current task gradient g is directly used for optimization whereas if g^T g_ref< 0, g is projected such that g^T g_ref= 0. Refer to Eq. 11 in <cit.> for the exact form of projection. In ER instead, since both  mini-batches are used in the optimization step, the average of g and g_ref is used.  

It may seem a bit counter-intuitive that, even though ER repetitively trains on , it is still able to generalize to previous tasks beyond the episodic memory. We investigate this question in §<ref>. 


Since we study the usage of tiny episodic memories, the sample that the learner selects to populate the memory becomes crucial, see  of the algorithm. For this, we describe various strategies to write into the memory. 
All these strategies assume access to a continuous stream of data and a small episodic memory, which rules out approaches relying on the temporary storage of all the examples seen so far. This restriction is consistent with our definition of CL: a learning experience through a stream of data under the constraint of a fixed and small sized memory and limited compute budget.






  
Reservoir Sampling: Similarly to <cit.>, Reservoir sampling <cit.> takes as input a stream of data of unknown length 
and returns a random subset of items from that stream.
If `n' is the number of points observed so far and `' is the size of the reservoir (sampling buffer), this selection strategy samples each data point with a probability /n. The routine to update the memory is given in Appendix Alg. <ref>.



  
Ring Buffer: Similarly to <cit.>, for each task, the ring buffer strategy allocates as many equally sized FIFO buffers as there are classes. 
If C is the total number of classes across all tasks, and  is the total size of episodic memory, each stack has a buffer of size /C.
As shown in Appendix Alg. <ref>, the memory stores the last few observations from each class. Unlike reservoir sampling, samples from older tasks do not change 
throughout training, leading to potentially stronger overfitting. Also, at early stages of training the memory is not fully utilized since each stack has a constant size 
throughout training.
However, this simple sampling strategy guarantees equal representation of all classes in the 
memory, which is particularly important when the memory is tiny.



  
k-Means: For each class, we use online k-Means to estimate the k centroids in feature space, using the representation before the last classification layer. 
We then store in the memory the input examples whose feature representation is the closest to such centroids, see Appendix Alg. <ref>. This memory writing strategy
has similar benefits and drawbacks of ring buffer, except that it has potentially better coverage of the feature space in L2 sense.  



  
Mean of Features (MoF): Similarly to <cit.>, for each class we compute a running estimate of the average feature vector 
just before the classification layer and store examples whose feature representation is closest to the average feature vector (see details in Appendix Alg. <ref>). This writing strategy has the same balancing guarantees of ring buffer and k-means, but it populates the memory differently.
Instead of populating the memory at random or using k-Means, it puts examples that are closest to the mode in feature space.





§ EXPERIMENTS
 
In this section, we review the benchmark datasets used in our evaluation, as well as the architectures and the baselines we compared against.
We then report the results we obtained using episodic memory and experience replay (ER). Finally, we conclude with a brief analysis investigating generalization when using 
ER on tiny memories.



 §.§ Datasets

We consider four commonly used benchmarks in CL literature. Permuted MNIST <cit.> is a variant of MNIST <cit.> 
dataset of handwritten digits where each task has a certain random permutation of the input pixels which is applied to all the images of that task. 
Our Permuted MNIST benchmark consists of a total of 23 tasks. 

Split CIFAR <cit.> consists of splitting the original CIFAR-100 dataset <cit.> into 20 disjoint subsets, 
each of which is considered as a separate task. Each task has 5 classes that are randomly sampled without replacement from the total of 100 classes. 

Similarly to Split CIFAR, Split miniImageNet is constructed by splitting miniImageNet <cit.>, a 
subset of ImageNet with a total of 100 classes and 600 images per class, to 20 disjoint subsets. 

Finally, Split CUB <cit.> is an incremental version of the fine-grained image classification dataset CUB <cit.> 
of 200 bird categories split into 20 disjoint subsets of classes. 

In all cases,  ^CV consists of 3 tasks while ^EV contains the remaining tasks. As described in § <ref>, we report metrics on 
^EV after doing a single training pass over each task in the sequence. The hyper-parameters selected via cross-validation on ^CV are reported 
in Appenddix Tab. <ref>.



 §.§ Architectures

For MNIST, we use a fully-connected network with two hidden layers of 256 ReLU units each. 
For CIFAR and miniImageNet, a reduced ResNet18, similar to <cit.>, is used and a standard ResNet18 with ImageNet pretraining is used for CUB. 
The input integer task id is used to select a task specific classifier head, and the network is trained via cross-entropy loss.

For a given dataset stream, all baselines use the same architecture,
and all baselines are optimized via stochastic gradient descent with a mini-batch size equal to 10. 
The size of the mini-batch sampled from the episodic memory is also set to 10 irrespective of the size of the episodic buffer. 




 §.§ Baselines

We compare against the following baselines:


  * , a model trained continually without any regularization and episodic memory, with parameters of a  new task initialized 
from the parameters of the previous task. 
    
  *  <cit.>, a regularization-based approach that avoids catastrophic forgetting by limiting the learning of parameters 
critical to the performance of past tasks, as measured by the Fisher information matrix (FIM). In particular, we compute the FIM as a moving average similar to in <cit.> and online EWC in <cit.>.    
    
  *  <cit.>, a model that uses episodic memory as an optimization constraint to avoid catastrophic forgetting. Since <cit.> and have similar performance, we only consider the latter in our experiments due to its computational efficiency.
    
  *  <cit.>, a model that also leverages an episodic memory and uses a loss that approximates the dot products of the gradients of current and previous tasks to avoid forgetting. To make the experimental setting more comparable (in terms of SGD updates) to the other methods, we set the number of inner gradient steps to 1 for each outer Reptile <cit.> meta-update with the mini-batch size of 10.




 §.§ Results
 







In the first experiment, we measured average accuracy at the end of the learning experience on ^EV as a function of the size of the memory (detailed numerical results are provided in Appendix Tabs <ref>,<ref>,<ref>,<ref>). 
From the results in Fig. <ref>, we can make several observations. 

First, methods using ER greatly outperform not only the baseline approaches that do not have episodic memory (and ) but also state-of-the-art approaches relying on episodic memory of the same size (and ). Moreover, the ER variants outperform even when the episodic memory is very small.
For instance, on CIFAR the gain over brought by ER is 1.7% when the memory only stores 1 example per class, and more than 5% when the memory stores 13 examples per class.
This finding might seem quite surprising as repetitive training on a very small episodic memory may potentially lead to overfitting on the examples stored in the memory. We will investigate this finding in more depth in §<ref>. In the same setting, the gain compared to methods that do not use memory (and ) is 15% and about 28% when using a single example per class and 13 examples per class, respectively.


Second and not surprisingly, average accuracy increases with the memory size, and does not saturate at 13 examples per class which is our self-imposed limit.

Third, experience replay based on reservoir sampling works the best across the board except when the memory size is very small (less than 3 examples per class).
Empirically we observed that as more and more tasks arrive and the size of the memory per class shrinks, reservoir sampling often ends up evicting some of the earlier 
classes from the memory, thereby inducing higher forgetting. 

Fourth, when the memory is tiny, sampling methods that by construction guarantee a balanced number of samples per class, work the best (even better than reservoir sampling). 
All methods that have this property, ring buffer, k-Means and Mean of Features, have a rather similar performance which is substantially better than the reservoir sampling.
For instance, on CIFAR, with one example per class in the memory, ER with reservoir sampling is 3.5% worse than ER K-Means, but ER K-Means, ER Ring Buffer and ER MoF are all within 0.5% from each other 
(see Appendix Tab. <ref> for numerical values).  
These findings are further confirmed by looking at the evolution of the average accuracy (Appendix Fig. <ref> left) as new tasks arrive when the memory can store at most one example per class.






The better performance of strategies like ring buffer for tiny episodic memories, and reservoir sampling for bigger episodic memories, suggests a hybrid 
approach, whereby the writing strategy relies on reservoir sampling till some classes have too few samples stored in the memory. At that point, the writing strategy switches 
to the ring buffer scheme which guarantees a minimum number of examples for each class. 
For instance, in the experiment of Fig. <ref> the memory budget consists of only 85 memory slots, an average of 1 sample per class by the end of the learning experience (as there are 17 tasks and 5 classes per task). The learner switches 
from reservoir sampling to ring buffer once it observes that any of the classes seen in the past has only one sample left in the memory. 
When the switch happens (marked by a red vertical line in the figure), the learner only keeps randomly picked min(n,||/K) examples per class in the memory, 
where n is the number of examples of class c in the memory and K are the total number of classes observed so far. 
The overwriting happens opportunistically, removing examples
from over-represented classes as new classes are observed. Fig. <ref> shows that when the number of tasks is small, the hybrid version enjoys the high accuracy of reservoir sampling. As more tasks arrive
 and the memory per task shrinks, the hybrid scheme achieves superior performance than reservoir (and at least similar to ring buffer). 

Finally, experience replay methods are not only outperforming all other approaches in terms of accuracy 
(and lower forgetting as reported in Tab. <ref>), but also in terms of compute time. Tab. <ref> reports training time on both Split CIFAR and Split CUB, using ring buffer as a use case since
all other ER methods have the same computational complexity. We observe that ER adds only a slight overhead compared to the finetuning baseline, but it is much cheaper than 
stronger baseline methods like and .





 §.§ Analysis
 

The strong performance of experience replay methods which directly learn using the examples stored in the small episodic memory may be surprising. In fact, <cit.>
discounted this repetitive training on the memory option by saying: 
“Obviously, minimizing the loss at the current example together with [the loss on the episodic memory] results in overfitting to the
examples stored in [the memory]”. How can the repeated training over the same very small handful of examples possibly generalize? 


To investigate this matter we conducted an additional experiment. For simplicity, 
we consider only two tasks, T_1 and T_2, 
and study the generalization performance on T_1 as we train on T_2. 
We denote by _2 the training set of T_2 and by _1 the memory storing examples from T_1's training set. 
Our hypothesis is that although direct training on the examples in _1 (in addition to those coming from _2) 
does indeed lead to strong memorization of _1 (as measured by nearly zero cross-entropy loss on _1), such training is still overall beneficial 
in terms of generalization on the original task T_1 because the joint learning with the examples of the current task T_2 acts as a strong, albeit 
implicit and data-dependent, regularizer for T_1.

To validate this hypothesis, we consider the MNIST Rotations dataset <cit.>, where each task has digits rotated by a certain degree, a setting that enables fine control over the relatedness between the tasks. The architecture is the same as for Permuted MNIST, 
with only 10 memory slots, one for each class of T_1. 
First, we verified that the loss on _1 quickly drops to nearly 0 as the model is trained using both _1 and _2. 
As expected, the model achieves a perfect performance on the examples in the memory, which is not true for methods like which make less direct use of the memory (see Appendix Tab. <ref>).  
We then verified that only training on _1 without _2, yields strong overfitting to the examples in the memory and poor generalization performance, 
with a mere average accuracy of 40% on T_1 from the initial 85% which was obtained just after training on T_1.
If we only train on _2 without using _1 (same as baseline), we also observed overfitting to _2 as long as T_2 and T_1 are sufficiently 
unrelated, Fig. <ref>(b) and <ref>(c).   

When the two tasks are closely related instead (difference of rotation angles less than 20 degrees),  
we observe that even without the memory, generalization on T_1 improves 
as we train on T_2 because of positive transfer from the related task, see red curve in Fig. <ref>(a).
However, when we train on both _2 and _1, generalization on T_1 is better than baseline, , training with _2 only, regardless of the degree of relatedness between the two tasks, 
as shown by the green curves in Fig. <ref>. 

These findings suggest that while the model essentially memorizes the examples in the memory, this does not necessarily have a detrimental effect in terms of generalization 
as long as such learning is performed in conjunction with the examples of T_2. Moreover, there are two major axes controlling this regularizer: 
the number of examples in T_2 and
the relatedness between the tasks.
The former sets the strength of the regularizer. The latter, as measured by the accuracy on T_1
when training only on _2, controls its effectiveness. 
When T_1 and T_2 are closely related, Fig. <ref>(a), training on _2 prevents overfitting to _1 by providing 
a data-dependent regularization that, even by itself, produces positive transfer. 
When T_1 and T_2 are somewhat related, Fig. <ref>(b), training on _2 still improves generalization on T_1 albeit to a much lesser extent.
However, when the tasks are almost adversarial to each other as an upside down 2 may look like a 5, 
the resulting regularization becomes even harmful, Fig. <ref>(c). In this case, accuracy drops from 40% (training only on _1) 
to 30% (training on both _1 and _2).

One remaining question related to generalization is how ER relates to A-GEM <cit.> and whether A-GEM overfits even less?
The answer is positive. As shown in Appendix Tab. <ref>, A-GEM's accuracy on the memory examples does not reach 100% even after having processed 1000 samples.
Interestingly, accuracy on the training set is lower than ER suggesting that the more constrained weight updates of A-GEM make it actually underfit. This underfitting prevents A-GEM from reaping the full regularization benefits brought by training on the data of subsequent tasks. 








 §.§ ER Training Learns a More Expressive Function
 



Another numerical observation that could potentially explain the better performance gained by directly training on memory (ER) as opposed to using the memory as an optimization constraint (A-GEM) is the high empirical Lipschitz constant of the former. The empirical Lipschitz constant measures the sensitivity of the function f to its input , and formally defined as ||f(_i) - f(_j)||/||_i - _j||.

For a network to generalize well, one seeks to obtain a low Lipschitz function <cit.>. On the other extreme, having too low Lipschitz would restrict the expressive power of the network – a pathalogical case would be of a network that ends up learning a constant function with '0' empirical Lipschitz constant. A sweet spot is somewhere in between. In Fig. <ref>, we can observe that ER consistently learns a more expressive classifier – as measured by a higher empirical Lipschitz constant (refer to Appendix §<ref> for further details) – compared to  as training proceeds, which, we believe, eventually reflects in better performance.      





























§ CONCLUSIONS

In this work we studied ER methods for supervised CL tasks. Our empirical analysis on several
benchmark streams of data shows that ER methods even with a tiny episodic memory offer a very large performance boost at a very marginal increase of computational cost compared to the finetuning baseline. We also studied various ways to populate the memory and proposed a hybrid approach that strikes a good trade-off between randomizing the examples in the memory while keeping enough representatives for each class. 

Our study also sheds light into a very interesting phenomenon: memorization (zero cross-entropy loss) of tiny memories is useful for generalization because training on subsequent tasks acts like a data dependent regularizer. 
Overall, we hope the CL community will adopt experience replay methods as a baseline, given their strong empirical performance, efficiency and simplicity of implementation.

There are several avenues of future work. For instance, we would like to investigate what are the optimal inputs that best mitigate expected forgetting and
optimal strategies to remove samples from the memory when it is entirely filled up. 



named




§ APPENDIX

In §<ref>, we provide algorithms for different memory update strategies described in §<ref> of the main paper. The detailed results of the experiments which were used to generate Fig. <ref> and Tab. <ref> in the main paper are provided in §<ref>. The analysis conducted in §<ref> of the main paper is further described in §<ref>. Finally, in §<ref>, we list the hyper-parameters used for each of the baselines across all the datasets.  





§ MEMORY UPDATE ALGORITHMS
 

Here we provide the algorithms to write into memory as discussed in §<ref> of the main paper. 











§ DETAILED RESULTS
 

Here we describe the detailed results used to generate the Fig. <ref> in the main paper. In addition we also report the forgetting metric (<ref>). Note that the  baseline does not follow the definition of continual learning as it keeps the dataset of all the tasks around at every step. 
























§ FURTHER ANALYSIS
 



In Tab. <ref>, we provide train, memory and test set performance on both the  and  with two different configurations of tasks; similar tasks (10 rotation), dissimilar tasks (90 rotation). It can be seen from the table, and as argued in the §<ref> of the main paper that  always achieves the perfect performance on the memory. To achieve the same effect with  one has to train for more iterations. 



 §.§ Computation of Empirical Lipschiz Constant
 
Here we describe the procedure to compute the empirical Lipschitz constant used in §<ref> of the main paper. After training the network for task k, we sample 200 pairs, where each pair (_i, _j) ∼^k. Each pair is then passed through the network to compute ||f(_i) - f(_j)||_2/||_i - _j||_2, and finally the values are averaged across the 200 pairs to compute the single empirical Lipschitz constant for task k. 





§ HYPER-PARAMETER SELECTION
 











































§ ANALYSIS




  
Setup We use CIFAR-100 dataset with two variants of ResNet18; smaller ResNet which has three times less feature maps across all layers than the standard ResNet and bigger ResNet which is a standard ResNet. For ER-Random and ER-Ideal, a fixed batch size of 10 is used for both the current task and episodic memory. These batches are concatenated and a single forward/ backward pass is done.   
















































