<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article SYSTEM "http://jats.nlm.nih.gov/archiving/1.2/JATS-archivearticle1.dtd"><article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="1.2" article-type="research-article" xml:lang="en"><?properties open_access?><front><journal-meta><journal-id journal-id-type="publisher-id">42256</journal-id><journal-id journal-id-type="doi">10.1038/42256.2522-5839</journal-id><journal-title-group><journal-title>Nature Machine Intelligence</journal-title><abbrev-journal-title abbrev-type="publisher">Nat Mach Intell</abbrev-journal-title></journal-title-group><issn pub-type="epub">2522-5839</issn><publisher><publisher-name>Nature Publishing Group UK</publisher-name><publisher-loc>London</publisher-loc></publisher></journal-meta><article-meta><article-id pub-id-type="publisher-id">s42256-022-00568-3</article-id><article-id pub-id-type="manuscript">568</article-id><article-id pub-id-type="doi">10.1038/s42256-022-00568-3</article-id><article-categories><subj-group subj-group-type="heading"><subject>Article</subject></subj-group><subj-group subj-group-type="SubjectPath"><subject>/639/705/117</subject></subj-group><subj-group subj-group-type="SubjectPath"><subject>/639/705/794</subject></subj-group><subj-group subj-group-type="SubjectPath"><subject>/631/378/116/2396</subject></subj-group><subj-group subj-group-type="NatureArticleTypeID"><subject>article</subject></subj-group></article-categories><title-group><article-title xml:lang="en">Three types of incremental learning</article-title></title-group><contrib-group><contrib contrib-type="author" corresp="yes" id="Au1"><contrib-id contrib-id-type="orcid">http://orcid.org/0000-0002-5239-5660</contrib-id><name><surname>van de Ven</surname><given-names>Gido M.</given-names></name><xref ref-type="aff" rid="Aff1">1</xref><xref ref-type="aff" rid="Aff2">2</xref><xref ref-type="aff" rid="Aff3">3</xref><xref ref-type="corresp" rid="IDs42256022005683_cor1">a</xref></contrib><contrib contrib-type="author" id="Au2"><name><surname>Tuytelaars</surname><given-names>Tinne</given-names></name><xref ref-type="aff" rid="Aff3">3</xref></contrib><contrib contrib-type="author" id="Au3"><contrib-id contrib-id-type="orcid">http://orcid.org/0000-0002-4305-6376</contrib-id><name><surname>Tolias</surname><given-names>Andreas S.</given-names></name><xref ref-type="aff" rid="Aff1">1</xref><xref ref-type="aff" rid="Aff4">4</xref></contrib><aff id="Aff1"><label>1</label><institution-wrap><institution-id institution-id-type="GRID">grid.39382.33</institution-id><institution-id institution-id-type="ISNI">0000 0001 2160 926X</institution-id><institution content-type="org-name">Center for Neuroscience and Artificial Intelligence, Department of Neuroscience, Baylor College of Medicine</institution></institution-wrap><addr-line content-type="city">Houston</addr-line><addr-line content-type="state">TX</addr-line><country country="US">USA</country></aff><aff id="Aff2"><label>2</label><institution-wrap><institution-id institution-id-type="GRID">grid.5335.0</institution-id><institution-id institution-id-type="ISNI">0000000121885934</institution-id><institution content-type="org-name">Computational and Biological Learning Lab, Department of Engineering, University of Cambridge</institution></institution-wrap><addr-line content-type="city">Cambridge</addr-line><country country="GB">UK</country></aff><aff id="Aff3"><label>3</label><institution-wrap><institution-id institution-id-type="GRID">grid.5596.f</institution-id><institution-id institution-id-type="ISNI">0000 0001 0668 7884</institution-id><institution content-type="org-name">Processing Speech and Images, Department of Electrical Engineering, KU Leuven</institution></institution-wrap><addr-line content-type="city">Leuven</addr-line><country country="BE">Belgium</country></aff><aff id="Aff4"><label>4</label><institution-wrap><institution-id institution-id-type="GRID">grid.21940.3e</institution-id><institution-id institution-id-type="ISNI">0000 0004 1936 8278</institution-id><institution content-type="org-division">Department of Electrical and Computer Engineering</institution><institution content-type="org-name">Rice University</institution></institution-wrap><addr-line content-type="city">Houston</addr-line><addr-line content-type="state">TX</addr-line><country country="US">USA</country></aff></contrib-group><author-notes><corresp id="IDs42256022005683_cor1"><label>a</label><email>gido.vandeven@kuleuven.be</email></corresp></author-notes><pub-date date-type="pub" publication-format="electronic"><day>5</day><month>12</month><year>2022</year></pub-date><pub-date date-type="pub" publication-format="print"><month>12</month><year>2022</year></pub-date><volume>4</volume><issue seq="16">12</issue><fpage>1185</fpage><lpage>1197</lpage><history><date date-type="registration"><day>18</day><month>10</month><year>2022</year></date><date date-type="received"><day>1</day><month>10</month><year>2021</year></date><date date-type="accepted"><day>18</day><month>10</month><year>2022</year></date><date date-type="online"><day>5</day><month>12</month><year>2022</year></date></history><permissions><copyright-statement>© The Author(s) 2022</copyright-statement><copyright-year>2022</copyright-year><license license-type="open-access" xlink:href="http://creativecommons.org/licenses/by/4.0/"><license-p><bold>Open Access</bold> This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this license, visit <ext-link xlink:href="http://creativecommons.org/licenses/by/4.0/" ext-link-type="url">http://creativecommons.org/licenses/by/4.0/</ext-link>.</license-p></license></permissions><abstract id="Abs1" xml:lang="en"><title>Abstract</title><p id="Par1">Incrementally learning new information from a non-stationary stream of data, referred to as ‘continual learning’, is a key feature of natural intelligence, but a challenging problem for deep neural networks. In recent years, numerous deep learning methods for continual learning have been proposed, but comparing their performances is difficult due to the lack of a common framework. To help address this, we describe three fundamental types, or ‘scenarios’, of continual learning: task-incremental, domain-incremental and class-incremental learning. Each of these scenarios has its own set of challenges. To illustrate this, we provide a comprehensive empirical comparison of currently used continual learning strategies, by performing the Split MNIST and Split CIFAR-100 protocols according to each scenario. We demonstrate substantial differences between the three scenarios in terms of difficulty and in terms of the effectiveness of different strategies. The proposed categorization aims to structure the continual learning field, by forming a key foundation for clearly defining benchmark problems.</p></abstract><abstract id="Abs2" xml:lang="en"><p id="Par2">A challenge for any machine learning system is to continually adapt to new data. While methods to address this issue are developed, their performance is hard to compare. A new framework to facilitate benchmarking divides approaches into three categories, defined by whether models need to adapt to new tasks, domains or classes.</p></abstract><funding-group><award-group><funding-source><institution-wrap><institution>International Brain Research Organization (IBRO)</institution><institution-id institution-id-type="doi" vocab="open-funder-registry">https://doi.org/10.13039/501100001675</institution-id></institution-wrap></funding-source></award-group><award-group><funding-source><institution-wrap><institution>EC | EU Framework Programme for Research and Innovation H2020 | H2020 Priority Excellent Science | H2020 European Research Council (H2020 Excellent Science - European Research Council)</institution><institution-id institution-id-type="doi" vocab="open-funder-registry">https://doi.org/10.13039/100010663</institution-id></institution-wrap></funding-source><award-id award-type="FundRef grant">101021347</award-id><principal-award-recipient><name><surname>Tuytelaars</surname><given-names>Tinne</given-names></name></principal-award-recipient></award-group><award-group><funding-source><institution-wrap><institution>United States Department of Defense | Defense Advanced Research Projects Agency (DARPA)</institution><institution-id institution-id-type="doi" vocab="open-funder-registry">https://doi.org/10.13039/100000185</institution-id></institution-wrap></funding-source><award-id award-type="FundRef grant">HR0011-18-2-0025</award-id><principal-award-recipient><name><surname>Tolias</surname><given-names>Andreas S.</given-names></name></principal-award-recipient></award-group><award-group><funding-source><institution-wrap><institution>ODNI | Intelligence Advanced Research Projects Activity (IARPA)</institution><institution-id institution-id-type="doi" vocab="open-funder-registry">https://doi.org/10.13039/100011039</institution-id></institution-wrap></funding-source><award-id award-type="FundRef grant">D16PC00003</award-id><principal-award-recipient><name><surname>Tolias</surname><given-names>Andreas S.</given-names></name></principal-award-recipient></award-group><award-group><funding-source><institution-wrap><institution>U.S. Department of Health &amp; Human Services | National Institutes of Health (NIH)</institution><institution-id institution-id-type="doi" vocab="open-funder-registry">https://doi.org/10.13039/100000002</institution-id></institution-wrap></funding-source><award-id award-type="FundRef grant">R01MH109556</award-id><award-id award-type="FundRef grant">P30EY002520</award-id><principal-award-recipient><name><surname>Tolias</surname><given-names>Andreas S.</given-names></name></principal-award-recipient><principal-award-recipient><name><surname>Tolias</surname><given-names>Andreas S.</given-names></name></principal-award-recipient></award-group></funding-group><custom-meta-group><custom-meta><meta-name>publisher-imprint-name</meta-name><meta-value>Nature Portfolio</meta-value></custom-meta><custom-meta><meta-name>volume-issue-count</meta-name><meta-value>12</meta-value></custom-meta><custom-meta><meta-name>issue-article-count</meta-name><meta-value>24</meta-value></custom-meta><custom-meta><meta-name>issue-toc-levels</meta-name><meta-value>0</meta-value></custom-meta><custom-meta><meta-name>issue-pricelist-year</meta-name><meta-value>2022</meta-value></custom-meta><custom-meta><meta-name>issue-copyright-holder</meta-name><meta-value>The Author(s), under exclusive licence to Springer Nature Limited</meta-value></custom-meta><custom-meta><meta-name>issue-copyright-year</meta-name><meta-value>2022</meta-value></custom-meta><custom-meta><meta-name>article-contains-esm</meta-name><meta-value>Yes</meta-value></custom-meta><custom-meta><meta-name>article-numbering-style</meta-name><meta-value>Unnumbered</meta-value></custom-meta><custom-meta><meta-name>article-registration-date-year</meta-name><meta-value>2022</meta-value></custom-meta><custom-meta><meta-name>article-registration-date-month</meta-name><meta-value>10</meta-value></custom-meta><custom-meta><meta-name>article-registration-date-day</meta-name><meta-value>18</meta-value></custom-meta><custom-meta><meta-name>article-toc-levels</meta-name><meta-value>0</meta-value></custom-meta><custom-meta><meta-name>toc-levels</meta-name><meta-value>0</meta-value></custom-meta><custom-meta><meta-name>volume-type</meta-name><meta-value>Regular</meta-value></custom-meta><custom-meta><meta-name>journal-product</meta-name><meta-value>NonStandardArchiveJournal</meta-value></custom-meta><custom-meta><meta-name>numbering-style</meta-name><meta-value>Unnumbered</meta-value></custom-meta><custom-meta><meta-name>article-grants-type</meta-name><meta-value>OpenChoice</meta-value></custom-meta><custom-meta><meta-name>metadata-grant</meta-name><meta-value>OpenAccess</meta-value></custom-meta><custom-meta><meta-name>abstract-grant</meta-name><meta-value>OpenAccess</meta-value></custom-meta><custom-meta><meta-name>bodypdf-grant</meta-name><meta-value>OpenAccess</meta-value></custom-meta><custom-meta><meta-name>bodyhtml-grant</meta-name><meta-value>OpenAccess</meta-value></custom-meta><custom-meta><meta-name>bibliography-grant</meta-name><meta-value>OpenAccess</meta-value></custom-meta><custom-meta><meta-name>esm-grant</meta-name><meta-value>OpenAccess</meta-value></custom-meta><custom-meta><meta-name>online-first</meta-name><meta-value>false</meta-value></custom-meta><custom-meta><meta-name>pdf-file-reference</meta-name><meta-value>BodyRef/PDF/42256_2022_Article_568.pdf</meta-value></custom-meta><custom-meta><meta-name>pdf-type</meta-name><meta-value>Typeset</meta-value></custom-meta><custom-meta><meta-name>target-type</meta-name><meta-value>OnlinePDF</meta-value></custom-meta><custom-meta><meta-name>issue-online-date-year</meta-name><meta-value>2022</meta-value></custom-meta><custom-meta><meta-name>issue-online-date-month</meta-name><meta-value>12</meta-value></custom-meta><custom-meta><meta-name>issue-online-date-day</meta-name><meta-value>14</meta-value></custom-meta><custom-meta><meta-name>issue-type</meta-name><meta-value>Regular</meta-value></custom-meta><custom-meta><meta-name>article-type</meta-name><meta-value>OriginalPaper</meta-value></custom-meta><custom-meta><meta-name>journal-subject-primary</meta-name><meta-value>Engineering</meta-value></custom-meta><custom-meta><meta-name>journal-subject-secondary</meta-name><meta-value>Engineering, general</meta-value></custom-meta><custom-meta><meta-name>journal-subject-collection</meta-name><meta-value>Engineering</meta-value></custom-meta><custom-meta><meta-name>open-access</meta-name><meta-value>true</meta-value></custom-meta></custom-meta-group></article-meta></front><body><sec id="Sec1"><title>Main</title><p id="Par3">An important open problem in deep learning is enabling neural networks to incrementally learn from non-stationary streams of data<sup><xref ref-type="bibr" rid="CR1">1</xref>,<xref ref-type="bibr" rid="CR2">2</xref></sup>. For example, when deep neural networks are trained on samples from a new task or data distribution, they tend to rapidly lose previously acquired capabilities, a phenomenon referred to as catastrophic forgetting<sup><xref ref-type="bibr" rid="CR3">3</xref>,<xref ref-type="bibr" rid="CR4">4</xref></sup>. In stark contrast, humans and other animals are able to incrementally learn new skills without compromising those that were already learned<sup><xref ref-type="bibr" rid="CR5">5</xref></sup>. The field of continual learning, also referred to as lifelong learning, is devoted to closing the gap in incremental learning ability between natural and artificial intelligence. In recent years, this area of machine learning research has been rapidly expanding, fuelled by the potential utility of deploying continual learning algorithms for applications such as medical diagnosis<sup><xref ref-type="bibr" rid="CR6">6</xref></sup>, autonomous driving<sup><xref ref-type="bibr" rid="CR7">7</xref></sup> or predicting financial markets<sup><xref ref-type="bibr" rid="CR8">8</xref></sup>.</p><p id="Par4">Despite its scope, continual learning research is relatively unstructured and the field lacks a shared framework. Because of an abundance of subtle, but often important, differences between evaluation protocols, systematic comparison between continual learning algorithms is challenging, even when papers use the same datasets<sup><xref ref-type="bibr" rid="CR9">9</xref></sup>. It is therefore not surprising that numerous continual learning methods claim to be state-of-the-art. To help address this, here we describe a structured and intuitive framework for continual learning.</p><p id="Par5">We put forward the view that, at the computational level<sup><xref ref-type="bibr" rid="CR10">10</xref></sup>, there are three fundamental types, or ‘scenarios’, of supervised continual learning. Informally, (a) in task-incremental learning, an algorithm must incrementally learn a set of clearly distinguishable tasks; (b) in domain-incremental learning, an algorithm must learn the same kind of problem but in different contexts; and (c) in class-incremental learning, an algorithm must incrementally learn to distinguish between a growing number of objects or classes. In this article, we formally define these three scenarios and point out different challenges associated with each one of them. We also review existing strategies for continual learning with deep neural networks and we provide a comprehensive, empirical comparison to test how suitable these different strategies are for each scenario.</p></sec><sec id="Sec2"><title>Three continual learning scenarios</title><p id="Par6">In classical machine learning, an algorithm has access to all training data at the same time. In continual learning, the data instead arrives in a sequence, or in a number of steps, and the underlying distribution of the data changes over time. In this article, we propose that, depending on how the aspect of the data that changes over time relates to the function or mapping that must be learned, there are three fundamental ways in which a supervised learning problem can be incremental (Table <xref rid="Tab1" ref-type="table">1</xref>). Below, we start by describing the resulting three continual learning scenarios intuitively. After that we define them more formally: first in a restricted, ‘academic’ setting, before generalizing them to more flexible continual learning settings.<table-wrap id="Tab1"><label>Table 1</label><caption xml:lang="en"><p>Overview of the three continual learning scenarios</p></caption><table frame="hsides" rules="groups"><thead><tr><th><p>Scenario</p></th><th><p>Intuitive description</p></th><th><p>Mapping to learn</p></th></tr></thead><tbody><tr><td><p><bold>Task-incremental learning</bold></p></td><td><p>Sequentially learn to solve a number of distinct tasks</p></td><td><p><inline-formula id="IEq1"><alternatives><mml:math><mml:mrow><mml:mspace width="2.22144pt"/><mml:mi>f</mml:mi><mml:mspace width="0.25em"/><mml:mo>:</mml:mo><mml:mi class="MJX-tex-caligraphic" mathvariant="script">X</mml:mi><mml:mo>×</mml:mo><mml:mi class="MJX-tex-caligraphic" mathvariant="script">C</mml:mi><mml:mo>→</mml:mo><mml:mi class="MJX-tex-caligraphic" mathvariant="script">Y</mml:mi></mml:mrow></mml:math><tex-math id="IEq1_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$$\hspace{2.22144pt}f\,:{{{\mathcal{X}}}}\times {{{\mathcal{C}}}}\to {{{\mathcal{Y}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq1.gif"/></alternatives></inline-formula></p></td></tr><tr><td><p><bold>Domain-incremental learning</bold></p></td><td><p>Learn to solve the same problem in different contexts</p></td><td><p><inline-formula id="IEq2"><alternatives><mml:math><mml:mrow><mml:mspace width="2.22144pt"/><mml:mi>f</mml:mi><mml:mspace width="0.25em"/><mml:mo>:</mml:mo><mml:mi class="MJX-tex-caligraphic" mathvariant="script">X</mml:mi><mml:mo>→</mml:mo><mml:mi class="MJX-tex-caligraphic" mathvariant="script">Y</mml:mi></mml:mrow></mml:math><tex-math id="IEq2_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$$\hspace{2.22144pt}f\,:{{{\mathcal{X}}}}\to {{{\mathcal{Y}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq2.gif"/></alternatives></inline-formula></p></td></tr><tr><td><p><bold>Class-incremental learning</bold></p></td><td><p>Discriminate between incrementally observed classes</p></td><td><p><inline-formula id="IEq3"><alternatives><mml:math><mml:mrow><mml:mspace width="2.22144pt"/><mml:mi>f</mml:mi><mml:mspace width="0.25em"/><mml:mo>:</mml:mo><mml:mi class="MJX-tex-caligraphic" mathvariant="script">X</mml:mi><mml:mo>→</mml:mo><mml:mi class="MJX-tex-caligraphic" mathvariant="script">C</mml:mi><mml:mo>×</mml:mo><mml:mi class="MJX-tex-caligraphic" mathvariant="script">Y</mml:mi></mml:mrow></mml:math><tex-math id="IEq3_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$$\hspace{2.22144pt}f\,:{{{\mathcal{X}}}}\to {{{\mathcal{C}}}}\times {{{\mathcal{Y}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq3.gif"/></alternatives></inline-formula></p></td></tr></tbody></table><table-wrap-foot><p>Notation: <inline-formula id="IEq4"><alternatives><mml:math><mml:mi class="MJX-tex-caligraphic" mathvariant="script">X</mml:mi></mml:math><tex-math id="IEq4_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{\mathcal{X}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq4.gif"/></alternatives></inline-formula> is the input space, <inline-formula id="IEq5"><alternatives><mml:math><mml:mi class="MJX-tex-caligraphic" mathvariant="script">Y</mml:mi></mml:math><tex-math id="IEq5_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{\mathcal{Y}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq5.gif"/></alternatives></inline-formula> is the within-context output space and <inline-formula id="IEq6"><alternatives><mml:math><mml:mi class="MJX-tex-caligraphic" mathvariant="script">C</mml:mi></mml:math><tex-math id="IEq6_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{\mathcal{C}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq6.gif"/></alternatives></inline-formula> is the context space. In this article, the term ‘context’ refers to an underlying distribution from which observations are sampled. The context changes over time. In the continual learning literature, the term ‘task’ is often used in a way analogous to how the term ‘context’ is used here.</p></table-wrap-foot></table-wrap></p><sec id="Sec3"><title>Intuitive descriptions and each scenario’s challenges</title><p id="Par7">The first continual learning scenario we refer to as ‘task-incremental learning’ (or Task-IL). This scenario is best described as the case where an algorithm must incrementally learn a set of distinct tasks (see refs. <sup><xref ref-type="bibr" rid="CR11">11</xref>–<xref ref-type="bibr" rid="CR13">13</xref></sup> for examples from the literature). The defining characteristic of task-incremental learning is that it is always clear to the algorithm—also at test time—which task must be performed. In practice, this could mean that task identity is explicitly provided, or that the tasks are clearly distinguishable. In this scenario it is possible to train models with task-specific components (for example, a separate output layer per task), or even to have a completely separate network for each task to be learned. In this last case there is no forgetting at all. The challenge with task-incremental learning, therefore, is not—or should not be—to simply prevent catastrophic forgetting, but rather to find effective ways to share learned representations across tasks, to optimize the trade-off between performance and computational complexity and to use information learned in one task to improve performance on other tasks (that is, to achieve positive forward or even backward transfer between tasks)<sup><xref ref-type="bibr" rid="CR14">14</xref>,<xref ref-type="bibr" rid="CR15">15</xref></sup>. These are still open challenges. Real-world examples of task-incremental learning are learning to play different sports or different musical instruments, because typically it is always clear which sport or instrument should be played.</p><p id="Par8">We call the second scenario ‘domain-incremental learning’ (or Domain-IL). In this scenario, the structure of the problem is always the same, but the context or input-distribution changes (for example, there are domain-shifts; see refs. <sup><xref ref-type="bibr" rid="CR16">16</xref>,<xref ref-type="bibr" rid="CR17">17</xref></sup>). Similarly to task-incremental learning, this scenario can be described as that an algorithm must incrementally learn a set of ‘tasks’ (although now it might be more intuitive to think of them as ‘domains’), but with the crucial difference that—at least at test time—the algorithm does not know to which task a sample belongs. However, identifying the task is not necessary, because each task has the same possible outputs (for example, the same classes are used in each task). Using task-specific components in this scenario is, however, only possible if an algorithm first identifies the task<sup><xref ref-type="bibr" rid="CR18">18</xref>–<xref ref-type="bibr" rid="CR23">23</xref></sup>, but that is not necessarily the most efficient strategy. Preventing forgetting ‘by design’ is therefore not possible with domain-incremental learning, and alleviating catastrophic forgetting is still an important unsolved challenge. Examples of this scenario are incrementally learning to recognize objects under variable lighting conditions<sup><xref ref-type="bibr" rid="CR24">24</xref></sup> (for example, indoors versus outdoors) or learning to drive in different weather conditions<sup><xref ref-type="bibr" rid="CR17">17</xref></sup>.</p><p id="Par9">The third continual learning scenario is ‘class-incremental learning’ (or Class-IL). This scenario is best described as the case where an algorithm must incrementally learn to discriminate between a growing number of objects or classes (for example, refs. <sup><xref ref-type="bibr" rid="CR25">25</xref>,<xref ref-type="bibr" rid="CR26">26</xref></sup>). An often used set-up for this scenario is that a sequence of classification-based tasks (although now it might be more intuitive to think of them as ‘episodes’) is encountered, whereby each task contains different classes and the algorithm must learn to distinguish between all classes<sup><xref ref-type="bibr" rid="CR19">19</xref>,<xref ref-type="bibr" rid="CR27">27</xref>,<xref ref-type="bibr" rid="CR28">28</xref></sup>. In this case, task identification is necessary to solve the problem, as it determines which possible classes the current sample might belong to. In other words, the algorithm should be able both to solve each individual task (that is, distinguish between classes within an episode) and to identify which task a sample belongs to (that is, distinguish between classes from different episodes). For example, an agent might first learn about cats and dogs, and later about cows and horses; while with task-incremental learning the agent would not be expected to distinguish between animals encountered in different episodes (for example, between cats and cows), with class-incremental learning this is required. An important challenge in this scenario is learning to discriminate between classes that are not observed together, which has turned out to be very challenging for deep neural networks, especially when storing examples of previously seen classes is not allowed<sup><xref ref-type="bibr" rid="CR29">29</xref>,<xref ref-type="bibr" rid="CR30">30</xref></sup>.</p></sec><sec id="Sec4"><title>Formalization in a restricted, ‘academic’ setting</title><p id="Par10">To more formally define these three scenarios, we start by considering the simple, but frequently studied, continual learning setting in which a classification problem is split up into multiple parts or episodes that must be learned sequentially, with no overlap between the different episodes. In the continual learning literature, these episodes are often called tasks, but in this article we will refer to them as ‘contexts’. The term task is problematic because in the literature it is used with several different meanings or connotations. From here on, we will use the term task only to refer to a context when it is always clear to the learning algorithm when a sample belongs to that context (as is the case with task-incremental learning).</p><p id="Par11">In the ‘academic continual learning setting’ sketched above (that is, classification-based, non-overlapping contexts encountered sequentially), a clear distinction can be drawn between the three scenarios. To formalize this, we express each sample as consisting of three components: an input <inline-formula id="IEq7"><alternatives><mml:math><mml:mrow><mml:mi>x</mml:mi><mml:mo>∈</mml:mo><mml:mi class="MJX-tex-caligraphic" mathvariant="script">X</mml:mi></mml:mrow></mml:math><tex-math id="IEq7_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{x}}}}\in {{{\mathcal{X}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq7.gif"/></alternatives></inline-formula>, a within-context label <inline-formula id="IEq8"><alternatives><mml:math><mml:mrow><mml:mi>y</mml:mi><mml:mo>∈</mml:mo><mml:mi class="MJX-tex-caligraphic" mathvariant="script">Y</mml:mi></mml:mrow></mml:math><tex-math id="IEq8_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$$y\in {{{\mathcal{Y}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq8.gif"/></alternatives></inline-formula> and a context label <inline-formula id="IEq9"><alternatives><mml:math><mml:mrow><mml:mi>c</mml:mi><mml:mo>∈</mml:mo><mml:mi class="MJX-tex-caligraphic" mathvariant="script">C</mml:mi></mml:mrow></mml:math><tex-math id="IEq9_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$$c\in {{{\mathcal{C}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq9.gif"/></alternatives></inline-formula>. The three scenarios can then be defined based on how the function or mapping that must be learned relates to the context space <inline-formula id="IEq10"><alternatives><mml:math><mml:mi class="MJX-tex-caligraphic" mathvariant="script">C</mml:mi></mml:math><tex-math id="IEq10_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{\mathcal{C}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq10.gif"/></alternatives></inline-formula>. With task-incremental learning, an algorithm is expected to learn a mapping of the form <inline-formula id="IEq11"><alternatives><mml:math><mml:mrow><mml:mi>f</mml:mi><mml:mspace width="0.25em"/><mml:mo>:</mml:mo><mml:mi class="MJX-tex-caligraphic" mathvariant="script">X</mml:mi><mml:mo>×</mml:mo><mml:mi class="MJX-tex-caligraphic" mathvariant="script">C</mml:mi><mml:mo>→</mml:mo><mml:mi class="MJX-tex-caligraphic" mathvariant="script">Y</mml:mi></mml:mrow></mml:math><tex-math id="IEq11_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$$f\,:{{{\mathcal{X}}}}\times {{{\mathcal{C}}}}\to {{{\mathcal{Y}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq11.gif"/></alternatives></inline-formula>, with domain-incremental learning a mapping of the form <inline-formula id="IEq12"><alternatives><mml:math><mml:mrow><mml:mi>f</mml:mi><mml:mspace width="0.25em"/><mml:mo>:</mml:mo><mml:mi class="MJX-tex-caligraphic" mathvariant="script">X</mml:mi><mml:mo>→</mml:mo><mml:mi class="MJX-tex-caligraphic" mathvariant="script">Y</mml:mi></mml:mrow></mml:math><tex-math id="IEq12_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$$f\,:{{{\mathcal{X}}}}\to {{{\mathcal{Y}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq12.gif"/></alternatives></inline-formula> must be learned and with class-incremental learning the shape of the mapping to be learned is <inline-formula id="IEq13"><alternatives><mml:math><mml:mrow><mml:mi>f</mml:mi><mml:mspace width="0.25em"/><mml:mo>:</mml:mo><mml:mi class="MJX-tex-caligraphic" mathvariant="script">X</mml:mi><mml:mo>→</mml:mo><mml:mi class="MJX-tex-caligraphic" mathvariant="script">C</mml:mi><mml:mo>×</mml:mo><mml:mi class="MJX-tex-caligraphic" mathvariant="script">Y</mml:mi></mml:mrow></mml:math><tex-math id="IEq13_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$$f\,:{{{\mathcal{X}}}}\to {{{\mathcal{C}}}}\times {{{\mathcal{Y}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq13.gif"/></alternatives></inline-formula>. For class-incremental learning this mapping can also be written as <inline-formula id="IEq14"><alternatives><mml:math><mml:mrow><mml:mi>f</mml:mi><mml:mspace width="0.25em"/><mml:mo>:</mml:mo><mml:mi class="MJX-tex-caligraphic" mathvariant="script">X</mml:mi><mml:mo>→</mml:mo><mml:mi class="MJX-tex-caligraphic" mathvariant="script">G</mml:mi></mml:mrow></mml:math><tex-math id="IEq14_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$$f\,:{{{\mathcal{X}}}}\to {{{\mathcal{G}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq14.gif"/></alternatives></inline-formula>, with <inline-formula id="IEq15"><alternatives><mml:math><mml:mi class="MJX-tex-caligraphic" mathvariant="script">G</mml:mi></mml:math><tex-math id="IEq15_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{\mathcal{G}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq15.gif"/></alternatives></inline-formula> the ‘global label space’ obtained by combining <inline-formula id="IEq16"><alternatives><mml:math><mml:mi class="MJX-tex-caligraphic" mathvariant="script">C</mml:mi></mml:math><tex-math id="IEq16_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{\mathcal{C}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq16.gif"/></alternatives></inline-formula> and <inline-formula id="IEq17"><alternatives><mml:math><mml:mi class="MJX-tex-caligraphic" mathvariant="script">Y</mml:mi></mml:math><tex-math id="IEq17_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{\mathcal{Y}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq17.gif"/></alternatives></inline-formula>.</p><p id="Par12">These definitions imply that the three scenarios can be distinguished based on whether at test time context identity information is known to the algorithm and, in case it is not, whether it must be inferred (Fig. <xref rid="Fig1" ref-type="fig">1</xref>). Each scenario thus specifies whether context labels are available during testing, but not necessarily whether they are available during training. With task- and class-incremental learning, it is often implicit that context labels are provided during training (for example, in the case of supervised learning), but with domain-incremental learning it is good practice to explicitly state whether context labels (or context boundaries) are provided during training.<fig id="Fig1"><label>Fig. 1</label><caption xml:lang="en"><title>Decision tree for the three continual learning scenarios.</title><p>The scenarios can be defined based on whether at test time context identity is known and if it is not, whether it must be inferred.</p></caption><p><graphic specific-use="HTML" mime-subtype="PNG" xlink:href="MediaObjects/42256_2022_568_Fig1_HTML.png"/></p></fig></p><p id="Par13">To illustrate the continual learning scenarios with an example, Fig. <xref rid="Fig2" ref-type="fig">2</xref> shows how Split MNIST, which is a popular toy problem for continual learning<sup><xref ref-type="bibr" rid="CR27">27</xref>,<xref ref-type="bibr" rid="CR28">28</xref>,<xref ref-type="bibr" rid="CR31">31</xref>,<xref ref-type="bibr" rid="CR32">32</xref></sup>, can be performed according to each of the three scenarios. Further examples illustrating these scenarios with other context sequences are provided in Supplementary Note <xref ref-type="supplementary-material" rid="MOESM1">1</xref>.<fig id="Fig2"><label>Fig. 2</label><caption xml:lang="en"><title>Split MNIST according to the three scenarios.</title><p><bold>a</bold>, The Split MNIST protocol is obtained by splitting the original MNIST dataset into five contexts, with each context consisting of two digits. <bold>b</bold>, Overview of what is expected of the algorithm at test time when the Split MNIST protocol is performed according to each continual learning scenario. <sup>a</sup>With task-incremental learning, at the computational level, there is no difference between whether the algorithm must return the within-context label or the global label, because the within-context label can be combined with the context label (which is provided as input) to get the global label.</p></caption><p><graphic specific-use="HTML" mime-subtype="PNG" xlink:href="MediaObjects/42256_2022_568_Fig2_HTML.png"/></p></fig></p><p id="Par14">It might be unintuitive to distinguish domain- and class-incremental learning by whether context identity must be inferred, because with class-incremental learning context identification is often not explicitly performed, as typically a direct mapping is learned from the input space <inline-formula id="IEq18"><alternatives><mml:math><mml:mi class="MJX-tex-caligraphic" mathvariant="script">X</mml:mi></mml:math><tex-math id="IEq18_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{\mathcal{X}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq18.gif"/></alternatives></inline-formula> to the set of global labels <inline-formula id="IEq19"><alternatives><mml:math><mml:mi class="MJX-tex-caligraphic" mathvariant="script">G</mml:mi></mml:math><tex-math id="IEq19_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{\mathcal{G}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq19.gif"/></alternatives></inline-formula>. Another way to tell these two scenarios apart is by whether different contexts contain the same classes (domain-incremental learning) or different classes (class-incremental learning). However, it should then be realized that whether two samples belong to the same class can change depending on perspective: in the Split MNIST example (Fig. <xref rid="Fig2" ref-type="fig">2</xref>), with domain-incremental learning the digits ‘0’ and ‘2’ belong to the same class (as they are both even digits), but with class-incremental learning they are considered different classes.</p></sec><sec id="Sec5"><title>Generalization to more flexible settings</title><p id="Par15">The clear separation between the three scenarios makes the academic continual learning setting convenient for studying these scenarios and their different challenges in isolation. However, this setting does not reflect well the arbitrary non-stationarity that can be observed in the real world<sup><xref ref-type="bibr" rid="CR33">33</xref>–<xref ref-type="bibr" rid="CR40">40</xref></sup>. To generalize the three scenarios to more flexible continual learning settings, we first introduce a distinction between the concepts ‘context set’ and ‘data stream’:</p><p id="Par16">The ‘context set’ is defined as a collection of underlying distributions, denoted by <inline-formula id="IEq20"><alternatives><mml:math><mml:msub><mml:mrow><mml:mfenced close="}" open="{"><mml:mrow><mml:msub><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">D</mml:mi></mml:mrow><mml:mrow><mml:mi>c</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:mrow><mml:mrow><mml:mi>c</mml:mi><mml:mo>∈</mml:mo><mml:mi class="MJX-tex-caligraphic" mathvariant="script">C</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="IEq20_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${\left\{{{{{\mathcal{D}}}}}_{c}\right\}}_{c\in {{{\mathcal{C}}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq20.gif"/></alternatives></inline-formula>, from which the observations presented to the algorithm are sampled. For a supervised continual learning problem, for each context <inline-formula id="IEq21"><alternatives><mml:math><mml:mrow><mml:mi>c</mml:mi><mml:mo>∈</mml:mo><mml:mi class="MJX-tex-caligraphic" mathvariant="script">C</mml:mi></mml:mrow></mml:math><tex-math id="IEq21_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$$c\in {{{\mathcal{C}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq21.gif"/></alternatives></inline-formula>, samples from <inline-formula id="IEq22"><alternatives><mml:math><mml:msub><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">D</mml:mi></mml:mrow><mml:mrow><mml:mi>c</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="IEq22_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\mathcal{D}}}}}_{c}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq22.gif"/></alternatives></inline-formula> consist of an input <inline-formula id="IEq23"><alternatives><mml:math><mml:mrow><mml:mi>x</mml:mi><mml:mo>∈</mml:mo><mml:mi class="MJX-tex-caligraphic" mathvariant="script">X</mml:mi></mml:mrow></mml:math><tex-math id="IEq23_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$$x\in {{{\mathcal{X}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq23.gif"/></alternatives></inline-formula> and a within-context label <inline-formula id="IEq24"><alternatives><mml:math><mml:mrow><mml:mi>y</mml:mi><mml:mo>∈</mml:mo><mml:mi class="MJX-tex-caligraphic" mathvariant="script">Y</mml:mi></mml:mrow></mml:math><tex-math id="IEq24_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$$y\in {{{\mathcal{Y}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq24.gif"/></alternatives></inline-formula>. (With class-incremental learning each context could also contain a single class, in which case the within-context label <italic>y</italic> is not used.)</p><p id="Par17">The ‘data stream’ is defined as a (possibly unbounded) stream of experiences that are sequentially presented to the algorithm: <italic>e</italic><sub>1</sub>, <italic>e</italic><sub>2</sub>, …. Each experience consists of a set of observations sampled from one or more of the underlying distributions of the context set. These experiences are the incremental steps of a continual learning problem, in the sense that at each step, the algorithm has free access to the data of the current experience, but not to the data from past or future experiences (see also ref. <sup><xref ref-type="bibr" rid="CR41">41</xref></sup>).</p><p id="Par18">In the academic continual-learning setting, there is no distinction between the context set and the data stream, because each experience consists of all the training data of a particular context. In general, however, such a direct relation is not needed. Every observation within each experience can in principle be sampled from any combination of underlying datasets from the context set. This can be formalized as:<disp-formula id="Equ1"><label>1</label><alternatives><mml:math><mml:mrow><mml:msub><mml:mrow><mml:mi>e</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo>[</mml:mo><mml:mrow><mml:mi>i</mml:mi></mml:mrow><mml:mo>]</mml:mo></mml:mrow><mml:mo>~</mml:mo><mml:munder><mml:mrow><mml:mo>∑</mml:mo></mml:mrow><mml:mrow><mml:mi>c</mml:mi><mml:mo>∈</mml:mo><mml:mi class="MJX-tex-caligraphic" mathvariant="script">C</mml:mi></mml:mrow></mml:munder><mml:msubsup><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>c</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>,</mml:mo><mml:mi>i</mml:mi></mml:mrow></mml:msubsup><mml:msub><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">D</mml:mi></mml:mrow><mml:mrow><mml:mi>c</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math><tex-math id="Equ1_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${e}_{t}[i] \sim \mathop{\sum}\limits_{c\in {{{\mathcal{C}}}}}{p}_{c}^{t,i}{{{{\mathcal{D}}}}}_{c}$$\end{document}</tex-math><graphic position="anchor" xlink:href="42256_2022_568_Article_Equ1.gif"/></alternatives></disp-formula>whereby <italic>e</italic><sub><italic>t</italic></sub>[<italic>i</italic>] is observation <italic>i</italic> of experience <italic>t</italic> and <inline-formula id="IEq25"><alternatives><mml:math><mml:msubsup><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>c</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>,</mml:mo><mml:mi>i</mml:mi></mml:mrow></mml:msubsup></mml:math><tex-math id="IEq25_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${p}_{c}^{t,i}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq25.gif"/></alternatives></inline-formula> is the probability that this observation is sampled from <inline-formula id="IEq26"><alternatives><mml:math><mml:msub><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">D</mml:mi></mml:mrow><mml:mrow><mml:mi>c</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="IEq26_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\mathcal{D}}}}}_{c}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq26.gif"/></alternatives></inline-formula>. Importantly, in this framework, from a probabilistic perspective, two observations at different points in time can only differ from each other with respect to the (combination of) contexts from which they are sampled. With this formulation, the context set describes the aspects of the data that ‘can’ change over time and the probabilities <inline-formula id="IEq27"><alternatives><mml:math><mml:msubsup><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>c</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>,</mml:mo><mml:mi>i</mml:mi></mml:mrow></mml:msubsup></mml:math><tex-math id="IEq27_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${p}_{c}^{t,i}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq27.gif"/></alternatives></inline-formula> describe ‘how’ they change over time.</p><p id="Par19">An advantage of distinguishing between the context set and the data stream is that it makes it possible to describe continual learning problems with gradual transitions between contexts<sup><xref ref-type="bibr" rid="CR34">34</xref>,<xref ref-type="bibr" rid="CR37">37</xref>,<xref ref-type="bibr" rid="CR40">40</xref>,<xref ref-type="bibr" rid="CR42">42</xref></sup> or whereby contexts are revisited<sup><xref ref-type="bibr" rid="CR43">43</xref>–<xref ref-type="bibr" rid="CR45">45</xref></sup>. In this framework, which is suitable for so-called ‘task-free continual learning’<sup><xref ref-type="bibr" rid="CR33">33</xref>,<xref ref-type="bibr" rid="CR46">46</xref>–<xref ref-type="bibr" rid="CR48">48</xref></sup>, generalized versions of the three scenarios can be defined based on how the mapping that must be learned relates to the context space <inline-formula id="IEq28"><alternatives><mml:math><mml:mi class="MJX-tex-caligraphic" mathvariant="script">C</mml:mi></mml:math><tex-math id="IEq28_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{\mathcal{C}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq28.gif"/></alternatives></inline-formula>, which describes the non-stationary aspect of the data. Supplementary Note <xref ref-type="supplementary-material" rid="MOESM1">2</xref> illustrates how a ‘task-free’ data stream can be performed according to each of the generalized versions of the three scenarios.</p><p id="Par20">We note that for complex real-world incremental learning problems, it might not be straight-forward to express the mapping that must be learned in terms of the context space <inline-formula id="IEq29"><alternatives><mml:math><mml:mi class="MJX-tex-caligraphic" mathvariant="script">C</mml:mi></mml:math><tex-math id="IEq29_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{\mathcal{C}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq29.gif"/></alternatives></inline-formula>, for example, because there are different aspects of the data that change over time. To accommodate this, a multidimensional context space <inline-formula id="IEq30"><alternatives><mml:math><mml:mi class="MJX-tex-caligraphic" mathvariant="script">C</mml:mi></mml:math><tex-math id="IEq30_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{\mathcal{C}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq30.gif"/></alternatives></inline-formula> can be used, whereby each dimension could adhere to a different scenario. This allows for continual-learning problems that are mixtures of scenarios (Supplementary Note <xref ref-type="supplementary-material" rid="MOESM1">3</xref>). Another generalization is that contexts do not need to be discrete, but can be continuous (in that case the summation in equation (<xref rid="Equ1" ref-type="disp-formula">1</xref>) becomes an integral); an example of a continuous context set is Rotated MNIST with arbitrary rotation (Supplementary Note <xref ref-type="supplementary-material" rid="MOESM1">3</xref>).</p></sec></sec><sec id="Sec6"><title>Empirical comparison</title><p id="Par21">To further explore the differences between the three continual learning scenarios, here we provide an empirical comparison of the performance of different deep learning strategies. To do this comparison in a structured manner, in Supplementary Note <xref ref-type="supplementary-material" rid="MOESM1">4</xref> we discuss and distinguish five computational strategies for continual learning (Fig. <xref rid="Fig3" ref-type="fig">3</xref>). For each strategy, we included a few representative methods in our comparison.<fig id="Fig3"><label>Fig. 3</label><caption xml:lang="en"><title>Schematic illustrations of different continual learning strategies.</title><p><bold>a</bold>, Context-specific components. Certain parts of the network are only used for specific contexts. <bold>b</bold>, Parameter regularization. Parameters important for past contexts are encouraged not to change too much when learning new contexts. <bold>c</bold>, Functional regularization. The input–output mapping learned previously is encouraged not to change too much at a particular set of inputs (the ‘anchor points’) when training on new contexts. <bold>d</bold>, Replay. The training data of a new context is complemented with data representative of past context. The replayed data is sampled from <italic>M</italic>, which can be a memory buffer or a generative model. <bold>e</bold>, Template-based classification. A ‘template’ is learned for each class (for example, a prototype, an energy value or a generative model), and classification is performed based on which template is most suitable for the sample to be classified. See Supplementary Note <xref ref-type="supplementary-material" rid="MOESM1">4</xref> for a detailed discussion of these strategies.</p></caption><p><graphic specific-use="HTML" mime-subtype="PNG" xlink:href="MediaObjects/42256_2022_568_Fig3_HTML.png"/></p></fig></p><sec id="Sec7"><title>Compared methods</title><p id="Par22">The use of context-specific components was represented by context-dependent gating (XdG<sup><xref ref-type="bibr" rid="CR12">12</xref></sup>), which masks for each context a randomly selected subset of hidden units; and the separate networks approach, where the available parameter budget is divided over all contexts and a separate network is learned for each context.</p><p id="Par23">Included parameter regularization methods were elastic weight consolidation (EWC<sup><xref ref-type="bibr" rid="CR49">49</xref></sup>), which estimates parameter importance using a diagonal approximation to the Fisher information; and synaptic intelligence (SI<sup><xref ref-type="bibr" rid="CR31">31</xref></sup>), which estimates parameter importance online based on the training trajectory.</p><p id="Par24">For functional regularization, compared were learning without forgetting (LwF<sup><xref ref-type="bibr" rid="CR50">50</xref></sup>), which uses the inputs from the current context as anchor points; and functional regularization of the memorable past (FROMP<sup><xref ref-type="bibr" rid="CR51">51</xref></sup>), which uses stored examples from past contexts as anchor points.</p><p id="Par25">The included replay methods were deep generative replay (DGR<sup><xref ref-type="bibr" rid="CR27">27</xref></sup>), which replays generated representations at the input level; brain-inspired replay (BI-R<sup><xref ref-type="bibr" rid="CR28">28</xref></sup>), which replays generated representations at the latent feature level; experience replay (ER<sup><xref ref-type="bibr" rid="CR52">52</xref>,<xref ref-type="bibr" rid="CR53">53</xref></sup>), which replays stored samples in the ‘standard way’ (that is, loss on replayed data added to loss on current data); and averaged gradient episodic memory (A-GEM<sup><xref ref-type="bibr" rid="CR54">54</xref></sup>), which replays the same stored samples but using the loss on replayed data as inequality constraint (that is, loss on current data optimized under constraint that loss on replayed data cannot increase).</p><p id="Par26">The compared template-based methods were iCaRL<sup><xref ref-type="bibr" rid="CR25">25</xref></sup>, with mean latent feature representations of stored examples as templates; and the generative classifier from ref. <sup><xref ref-type="bibr" rid="CR55">55</xref></sup>, which uses class-specific generative models as templates.</p><p id="Par27">Finally, two baselines were included. As lower target, referred to as ‘none’, the model was incrementally trained on all contexts in the standard way. As upper target, referred to as ‘joint’, the model was trained on the data of all contexts at the same time.</p></sec><sec id="Sec8"><title>Set-up</title><p id="Par28">We performed both the Split MNIST and the Split CIFAR-100 protocol according to each of the three scenarios. All experiments used the academic continual learning setting and context identity information was available during training. To make the comparisons as informative as possible, we used similar network architectures and similar training protocols for all compared methods. Depending on the continual learning scenario, the output layer of the network was treated differently. With task-incremental learning, a multi-headed output layer was used whereby each context had its own output units and only the units of the context under consideration were used. For the other two scenarios, single-headed output layers were used, with the number of output units equal to the number of classes per context (domain-incremental learning) or to the total number of classes (class-incremental learning). See Methods for more detail.</p></sec><sec id="Sec9"><title>Results</title><p id="Par29">For both Split MNIST (Table <xref rid="Tab2" ref-type="table">2</xref>) and Split CIFAR-100 (Table <xref rid="Tab3" ref-type="table">3</xref>), we found clear differences between the three continual learning scenarios. With task-incremental learning, almost all tested methods performed well compared to the ‘none’ and ‘joint’ baselines, with domain-incremental learning the relative performances of many methods dropped considerably and with class-incremental learning they decreased even further.<table-wrap id="Tab2"><label>Table 2</label><caption xml:lang="en"><p>Results on Split MNIST</p></caption><table frame="hsides" rules="groups"><thead><tr><th><p>Strategy</p></th><th><p>Method</p></th><th><p>Budget</p></th><th><p>GM</p></th><th><p>Task-IL</p></th><th><p>Domain-IL</p></th><th><p>Class-IL</p></th></tr></thead><tbody><tr><td><p>Baselines</p></td><td colspan="3"><p>None – lower target</p></td><td><p>84.32 (±0.99)</p></td><td><p>60.13 (±1.66)</p></td><td><p>19.89 (±0.02)</p></td></tr><tr><td/><td colspan="3"><p>Joint – upper target</p></td><td><p>99.67 (±0.03)</p></td><td><p>98.59 (±0.05)</p></td><td><p>98.17 (±0.04)</p></td></tr><tr><td><p>Context-specific components</p></td><td><p>Separate Networks</p></td><td><p>-</p></td><td><p>-</p></td><td><p>99.57 (±0.03)</p></td><td><p>-</p></td><td><p>-</p></td></tr><tr><td/><td><p>XdG</p></td><td><p>-</p></td><td><p>-</p></td><td><p>99.10 (±0.10)</p></td><td><p>-</p></td><td><p>-</p></td></tr><tr><td><p>Parameter regularization</p></td><td><p>EWC</p></td><td><p>-</p></td><td><p>-</p></td><td><p>99.06 (±0.15)</p></td><td><p>63.03 (±1.58)</p></td><td><p>20.64 (±0.52)</p></td></tr><tr><td/><td><p>SI</p></td><td><p>-</p></td><td><p>-</p></td><td><p>99.20 (±0.11)</p></td><td><p>66.94 (±1.13)</p></td><td><p>21.20 (±0.57)</p></td></tr><tr><td><p>Functional regularization</p></td><td><p>LwF</p></td><td><p>-</p></td><td><p>-</p></td><td><p>99.60 (±0.03)</p></td><td><p>71.18 (±1.42)</p></td><td><p>21.89 (±0.32)</p></td></tr><tr><td/><td><p>FROMP</p></td><td><p>100</p></td><td><p>-</p></td><td><p>99.12 (±0.13)</p></td><td><p>84.86 (±1.02)</p></td><td><p>77.38 (±0.64)</p></td></tr><tr><td><p>Replay</p></td><td><p>DGR</p></td><td><p>-</p></td><td><p>Yes</p></td><td><p>99.50 (±0.03)</p></td><td><p>95.57 (±0.30)</p></td><td><p>90.35 (±0.24)</p></td></tr><tr><td/><td><p>BI-R</p></td><td><p>-</p></td><td><p>Yes</p></td><td><p>99.61 (±0.03)</p></td><td><p>97.26 (±0.15)</p></td><td><p>94.41 (±0.15)</p></td></tr><tr><td/><td><p>ER</p></td><td><p>100</p></td><td><p>-</p></td><td><p>98.98 (±0.07)</p></td><td><p>93.75 (±0.24)</p></td><td><p>88.79 (±0.20)</p></td></tr><tr><td/><td><p>A-GEM</p></td><td><p>100</p></td><td><p>-</p></td><td><p>98.54 (±0.10)</p></td><td><p>87.67 (±1.33)</p></td><td><p>65.10 (±3.64)</p></td></tr><tr><td><p>Template-based classification</p></td><td><p>Generative Classifier</p></td><td><p>-</p></td><td><p>Yes</p></td><td><p>-</p></td><td><p>-</p></td><td><p>93.82 (±0.06)</p></td></tr><tr><td/><td><p>iCaRL</p></td><td><p>100</p></td><td><p>-</p></td><td><p>-</p></td><td><p>-</p></td><td><p>92.49 (±0.12)</p></td></tr></tbody></table><table-wrap-foot><p>Reported is the final test accuracy (as percentage, averaged over all contexts) of all compared methods on the Split MNIST protocol, which is performed according to all three scenarios. The experiments followed the academic continual learning setting and context identity information was available during training. The column ‘Budget’ indicates the number of examples per class that was allowed to be stored in a memory buffer. The column ‘GM’ indicates whether a generative model was learned, for which additional network capacity was used. Each experiment was performed 20 times with different random seeds, reported is the mean (±s.e.m.) over these runs.</p></table-wrap-foot></table-wrap><table-wrap id="Tab3"><label>Table 3</label><caption xml:lang="en"><p>Results on Split CIFAR-100</p></caption><table frame="hsides" rules="groups"><thead><tr><th><p>Strategy</p></th><th><p>Method</p></th><th><p>Budget</p></th><th><p>GM</p></th><th><p>Task-IL</p></th><th><p>Domain-IL</p></th><th><p>Class-IL</p></th></tr></thead><tbody><tr><td><p>Baselines</p></td><td colspan="3"><p>None – lower target</p></td><td><p>61.43 (±0.36)</p></td><td><p>18.42 (±0.33)</p></td><td><p>7.71 (±0.18)</p></td></tr><tr><td/><td colspan="3"><p>Joint – upper target</p></td><td><p>78.78 (±0.25)</p></td><td><p>46.85 (±0.51)</p></td><td><p>49.78 (±0.21)</p></td></tr><tr><td><p>Context-specific components</p></td><td><p>Separate Networks</p></td><td><p>-</p></td><td><p>-</p></td><td><p>76.83 (±0.25)</p></td><td><p>-</p></td><td><p>-</p></td></tr><tr><td/><td><p>XdG</p></td><td><p>-</p></td><td><p>-</p></td><td><p>69.86 (±0.34)</p></td><td><p>-</p></td><td><p>-</p></td></tr><tr><td><p>Parameter regularization</p></td><td><p>EWC</p></td><td><p>-</p></td><td><p>-</p></td><td><p>76.34 (±0.29)</p></td><td><p>21.65 (±0.55)</p></td><td><p>8.24 (±0.25)</p></td></tr><tr><td/><td><p>SI</p></td><td><p>-</p></td><td><p>-</p></td><td><p>74.84 (±0.39)</p></td><td><p>22.58 (±0.42)</p></td><td><p>8.10 (±0.24)</p></td></tr><tr><td><p>Functional regularization</p></td><td><p>LwF</p></td><td><p>-</p></td><td><p>-</p></td><td><p>78.59 (±0.24)</p></td><td><p>29.45 (±0.39)</p></td><td><p>25.57 (±0.27)</p></td></tr><tr><td><p>Replay</p></td><td><p>DGR</p></td><td><p>-</p></td><td><p>Yes</p></td><td><p>71.40 (±0.32)</p></td><td><p>20.52 (±0.43)</p></td><td><p>9.67 (±0.22)</p></td></tr><tr><td/><td><p>BI-R</p></td><td><p>-</p></td><td><p>Yes</p></td><td><p>79.14 (±0.21)</p></td><td><p>30.26 (±0.44)</p></td><td><p>25.81 (±0.41)</p></td></tr><tr><td/><td><p>ER</p></td><td><p>100</p></td><td><p>-</p></td><td><p>76.43 (±0.24)</p></td><td><p>39.00 (±0.34)</p></td><td><p>37.57 (±0.21)</p></td></tr><tr><td/><td><p>A-GEM</p></td><td><p>100</p></td><td><p>-</p></td><td><p>73.30 (±0.39)</p></td><td><p>20.51 (±0.59)</p></td><td><p>20.38 (±1.45)</p></td></tr><tr><td><p>Template-based classification</p></td><td><p>Generative Classifier</p></td><td><p>-</p></td><td><p>Yes</p></td><td><p>-</p></td><td><p>-</p></td><td><p>46.83 (±0.18)</p></td></tr><tr><td/><td><p>iCaRL</p></td><td><p>100</p></td><td><p>-</p></td><td><p>-</p></td><td><p>-</p></td><td><p>37.83 (±0.21)</p></td></tr></tbody></table><table-wrap-foot><p>Reported is the final test accuracy (as percentage, averaged over all contexts) of all compared methods on the Split CIFAR-100 protocol, which is performed according to all three scenarios. The experiments followed the academic continual learning setting and context identity information was available during training. The column ‘Budget’ indicates the number of examples per class that was allowed to be stored in a memory buffer. The column ‘GM’ indicates whether a generative model was learned, for which additional network capacity was used. Note that we were not able to run the method FROMP on this protocol due to its high computational costs. Each experiment was performed 10 times with different random seeds, reported is the mean (±s.e.m.) over these runs. All compared methods used convolutional layers that were pre-trained on CIFAR-10, see Methods for full details.</p></table-wrap-foot></table-wrap></p><p id="Par30">The decline in performance across the three scenarios was most pronounced for the parameter regularization methods. On both protocols, EWC and SI performed close to the upper target when context identity was known during testing (that is, task-incremental learning); with domain-incremental learning the performance of both methods was substantially lower, but remained above the lower target of sequentially training a network in the standard way; and with class-incremental learning the performance of EWC and SI was similar to the lower target, indicating that in this scenario these methods failed completely. There was a similar trend across the three scenarios for the functional regularization methods, albeit less pronounced for FROMP than for LwF.</p><p id="Par31">Replay-based methods performed relatively well in all three scenarios. Although on both protocols their performance still decreased from task- to domain- to class-incremental learning, the decline was less sharp than for the regularization-based methods, and replay-based methods were among the top performers in each scenario. Template-based classification also performed well with class-incremental learning, with iCaRL and the Generative Classifier among the best performing methods on both protocols.</p><p id="Par32">For class-incremental learning, the methods that performed best either used a generative model or they stored previously seen data in a memory buffer. Directly comparing methods using these two types of memories can be arbitrary, as their performance can heavily depend on the number of stored examples or the kind of generative model. We instead focus on comparing methods using the same type of memory.</p><p id="Par33">For methods using generative models, the largest differences were observed with Split CIFAR-100. In particular, DGR did not perform well on this protocol, indicating that standard generative replay (that is, at the input level) is not a good approach when the input data are complex (see also refs. <sup><xref ref-type="bibr" rid="CR28">28</xref>,<xref ref-type="bibr" rid="CR56">56</xref>,<xref ref-type="bibr" rid="CR57">57</xref></sup>). There was also a substantial gap in performance between BI-R and the Generative Classifier. As both methods had a generative model on the latent features, this suggests that the way in which a generative model is used (that is, for generating replay or as templates) is important as well.</p><p id="Par34">For methods using stored data, we found that replaying stored data in the standard way (as is done by ER) was not often outperformed by more complex ways of using stored data. In fact, perhaps surprisingly, on all experiments ER comfortably outperformed A-GEM, and ER performed significantly better than FROMP on two of the three scenarios of Split MNIST. These results held for different sizes of the memory buffer (Extended Data Fig. <xref rid="Fig1" ref-type="fig">1</xref>). A clear improvement over ER was only observed with iCaRL, and only when the size of the memory buffer was relatively small.</p></sec></sec><sec id="Sec10" sec-type="discussion"><title>Discussion</title><p id="Par35">Continual learning is a key feature of natural intelligence, but an open challenge for deep learning. Standard deep neural networks tend to catastrophically forget previous tasks or data distributions when trained on a new one. Enabling these networks to incrementally learn, and retain, information from different contexts has become a topic of intense research. Yet, despite its scope, the continual learning field lacks structure and direct comparisons between published papers can be misleading. Here, we pointed out that an important difference between continual learning set-ups is whether context identity is known to the algorithm and—if it is not—whether it must be inferred. Based on these two distinctions, we identified three scenarios for continual learning: task-incremental learning, domain-incremental learning and class-incremental learning.</p><p id="Par36">These three scenarios and their different challenges can be conveniently studied in an academic continual learning setting, where a classification-based problem is split up in discrete, non-overlapping contexts (which are often called ‘tasks’) that are encountered in sequence. We showed that in this setting there is a clear separation between the three scenarios. At least in part because of two preprints of this article<sup><xref ref-type="bibr" rid="CR58">58</xref>,<xref ref-type="bibr" rid="CR59">59</xref></sup>, the terms ‘task-incremental learning’, ‘domain-incremental learning’ and ‘class-incremental learning’ are sometimes being used in the recent literature in a way that restricts them to this academic setting. Here, by interpreting these three scenarios as specifying how the non-stationary aspect of the data relates to the mapping that must be learned, we propose that they generalize to more flexible continual-learning settings. To demonstrate the value of such generalized versions of these three scenarios, Supplementary Note <xref ref-type="supplementary-material" rid="MOESM1">2</xref> shows how a ‘task-free’ data stream without sharp context boundaries can also be performed in three different ways.</p><p id="Par37">A key insight of this article is that a useful way to categorize continual-learning problems is based on how the non-stationary aspect of the data relates to the mapping to be learned. For supervised classification this leads to the three continual learning scenarios discussed here, but the same perspective might also be useful for unsupervised or reinforcement learning (Supplementary Note <xref ref-type="supplementary-material" rid="MOESM1">5</xref>). Continual learning can be categorized in other ways as well, some of which we discuss in Supplementary Note <xref ref-type="supplementary-material" rid="MOESM1">6</xref>.</p><p id="Par38">Using the academic continual-learning setting, for each scenario we performed an empirical comparison of a representative selection of continual learning algorithms. This comparison revealed marked differences between the three scenarios in overall difficulty level and in the relative effectiveness of different continual learning strategies. The only strategy among the top performers in all three scenarios is replay, with the replayed data sampled either from a memory buffer or a generative model. Surprisingly, within the class of methods using stored data, the strongest performance is often obtained by the method ER, which replays stored data ‘in the standard way’. In our experiments, popular methods such as A-GEM and FROMP, which use stored data in more complex ways, are almost always outperformed by ER, even though the computational costs of A-GEM and FROMP are strictly higher than those of ER.</p><p id="Par39">In the class-incremental learning scenario, we found that parameter regularization methods such as EWC and SI fail almost completely, even on Split MNIST. Functional regularization typically works better, especially when using stored data as anchor points, but this strategy also does not work optimally. We hypothesize that regularization-based strategies—at least by themselves—are not well suited for class-incremental learning because they do not provide a way to compare between classes that are not observed together. Regularization-based methods aim to learn new contexts while preserving the function or parameters learned in previous contexts. However, with class-incremental learning, learning a new context (for example, distinguishing ‘2’ and ‘3’) while preserving what was learned before (for example, distinguishing ‘0’ and ‘1’) is not enough; it is also needed to combine information from different contexts (for example, for distinguishing ‘1’ and ‘2’). For learning to distinguish between classes not observed together, it might be unavoidable to use either replay, which allows for comparing between classes from different contexts during training, or template-based classification, which allows for comparing between classes from different contexts during inference (that is, during the classification decision).</p><p id="Par40">Task-incremental learning is sometimes considered ‘easy’, and it has been argued that the continual-learning community should move away from the assumption that context identities (or task labels, as they are often called) are provided at test time<sup><xref ref-type="bibr" rid="CR60">60</xref></sup>. A reason for this notion might be that with task-incremental learning, the bar is often set too low. In our experiments, while all methods indeed perform substantially better than the usual ‘lower target’ in which a single shared neural network is sequentially trained on all contexts, most methods perform worse than the more appropriate lower target in which a smaller, separate network is trained for each context. To do better than this ‘Separate Networks’ approach, positive forward or backward transfer between contexts is necessary, but achieving such positive transfer is not trivial<sup><xref ref-type="bibr" rid="CR14">14</xref>,<xref ref-type="bibr" rid="CR15">15</xref></sup>.</p><p id="Par41">Domain-incremental learning might be the least studied continual learning scenario. A few years ago this scenario was regularly studied with Permuted MNIST<sup><xref ref-type="bibr" rid="CR31">31</xref>,<xref ref-type="bibr" rid="CR49">49</xref>,<xref ref-type="bibr" rid="CR61">61</xref></sup>, but this protocol is not often used anymore as it is considered too artificial. The continual learning field is currently dominated by context sets created by splitting up existing image classification datasets based on class labels (for example, Split MNIST, Split CIFAR-100). Although in theory these context sets can be performed according to all three scenarios, they are typically less intuitive and/or realistic under the assumptions of domain-incremental learning. However, in recent years, several resources have been created that provide—or enable the generation of—more realistic context sets well suited for domain-incremental learning<sup><xref ref-type="bibr" rid="CR24">24</xref>,<xref ref-type="bibr" rid="CR41">41</xref>,<xref ref-type="bibr" rid="CR62">62</xref>–<xref ref-type="bibr" rid="CR64">64</xref></sup>. These resources might help to renew the community’s interest in this scenario.</p><p id="Par42">The three continual learning scenarios described in this article provide a useful basis for defining clear and unambiguous benchmark problems for continual learning. We hope this will accelerate progress to bridge the gap between natural and artificial intelligence. Moreover, we believe that it is an important conceptual insight that, at the computational level, a supervised learning problem can be incremental in these three different ways. Perhaps especially in the real world, where continual learning problems are often complex and ‘mixtures’ of scenarios, it might be fruitful to approach problems as consisting of a combination of these three fundamental types of incremental learning.</p></sec><sec id="Sec11" sec-type="methods"><title>Methods</title><p id="Par43">All experiments were run using custom-written code for the Python machine learning framework PyTorch<sup><xref ref-type="bibr" rid="CR65">65</xref></sup>.</p><sec id="Sec12"><title>Context sets</title><p id="Par44">For the Split MNIST protocol, the MNIST dataset<sup><xref ref-type="bibr" rid="CR66">66</xref></sup> was split into five contexts, such that each context contained two digits. The digits were randomly divided over the five contexts, so the order of the digits was different for each random seed. The original 28×28 pixel greyscale images were used without pre-processing. The standard training/test-split was used, which resulted in 60,000 training images (approximately 6,000 per digit) and 10,000 test images (approximately 1,000 per digit).</p><p id="Par45">For the Split CIFAR-100 protocol, the CIFAR-100 dataset<sup><xref ref-type="bibr" rid="CR67">67</xref></sup> was split up into ten contexts, such that each context contained ten image classes. The classes were randomly divided over the contexts, with a different class order for each random seed. The original 32×32 pixel RGB-colour images were normalized (that is, each pixel-value was subtracted by the relevant channel-wise mean and divided by the channel-wise standard deviation, with means and standard deviations calculated over all training images). No other pre-processing or augmentation was applied. The standard training/test-split was used, which resulted in 50,000 training images (500 per class) and 10,000 test images (100 per class).</p></sec><sec id="Sec13"><title>Base neural network architecture</title><p id="Par46">To make the comparisons as informative as possible, we used the same base neural network architecture for all methods as much as possible. For Split MNIST, the base network had two fully connected hidden layers of 400 ReLU each and a softmax output layer. For Split CIFAR-100, the base network had five pre-trained convolutional layers followed by two fully connected layers with 2,000 ReLU each and a softmax output layer. The convolutional layers contained 16, 32, 64, 128 and 256 channels. Each convolutional layer used a 3×3 kernel, a padding of 1 and there was a stride of 1 in the first layer (that is, no downsampling) and a stride of 2 in the other layers (that is, image-size was halved in each of those layers). Batch norm<sup><xref ref-type="bibr" rid="CR68">68</xref></sup> was used in all convolutional layers, followed by a ReLU non-linearity. No pooling was used. The convolutional layers were pre-trained on CIFAR-10, which is a dataset containing similar but non-overlapping images and image classes compared with CIFAR-100<sup><xref ref-type="bibr" rid="CR67">67</xref></sup>. To pre-train the convolutional layers, the base neural network was trained to classify the 10 classes of CIFAR-10 for 100 epochs, using the ADAM-optimizer (<italic>β</italic><sub>1</sub> = 0.9, <italic>β</italic><sub>2</sub> = 0.999) with learning rate of 0.0001 and mini-batch size of 256. For the pre-training on CIFAR-10, images were normalized and augmented by random cropping and horizontal flipping. A similar pre-training protocol was used in ref. <sup><xref ref-type="bibr" rid="CR28">28</xref></sup>. During the incremental training on CIFAR-100, the parameters of the pre-trained convolutional layers were frozen. For all compared methods, freezing these parameters resulted in similar or better performance compared with not freezing them.</p></sec><sec id="Sec14"><title>Output layer</title><p id="Par47">The softmax output layer of the network was treated differently depending on the continual learning scenario that was performed. With task-incremental learning, a multi-headed output layer was used, meaning that each context had its own output units and only the output units of the context under consideration—that is, either the current context or the replayed context—were set to ‘active’ (see next paragraph). With domain- and class-incremental learning, a single-headed output layer was used. For domain-incremental learning, this meant that all contexts used the same output units (that is, there were 2 output units for Split MNIST and 10 for Split CIFAR-100); for class-incremental learning, this meant that each class had its own output unit (that is, there were 10 output units for Split MNIST and 100 for Split CIFAR-100). With both domain- and class-incremental learning, always all output units were set to ‘active’. Note that with class-incremental learning another possibility is to use an ‘expanding head’ and only set the output units of classes seen so far to active (for example, see refs. <sup><xref ref-type="bibr" rid="CR28">28</xref>,<xref ref-type="bibr" rid="CR69">69</xref></sup>). We found that for our experiments there was not much difference in performance between these two options. Because all output units should always be active for the Bayesian interpretation of the parameter regularization methods<sup><xref ref-type="bibr" rid="CR21">21</xref></sup>, we decided to use that approach in this study.</p><p id="Par48">Whether an output unit was set to ‘active’ controlled whether a network could assign a positive probability to its corresponding class. The probability predicted by a neural network with parameters <italic>θ</italic> that an input <italic>x</italic> belongs to output class <italic>o</italic> was calculated as:<disp-formula id="Equ2"><label>2</label><alternatives><mml:math><mml:mrow><mml:msub><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>θ</mml:mi></mml:mrow></mml:msub><mml:mfenced close=")" open="("><mml:mrow><mml:mi>o</mml:mi><mml:mo>∣</mml:mo><mml:mi>x</mml:mi></mml:mrow></mml:mfenced><mml:mo>=</mml:mo><mml:mfenced open="{"><mml:mrow><mml:mtable><mml:mtr><mml:mtd columnalign="left"><mml:mfrac><mml:mrow><mml:msup><mml:mrow><mml:mi>e</mml:mi></mml:mrow><mml:mrow><mml:msubsup><mml:mrow><mml:mi>z</mml:mi></mml:mrow><mml:mrow><mml:mi>o</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mi>θ</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msubsup></mml:mrow></mml:msup></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mo mathsize="big">∑</mml:mo></mml:mrow><mml:mrow><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:msup><mml:mrow><mml:mi>e</mml:mi></mml:mrow><mml:mrow><mml:msubsup><mml:mrow><mml:mi>z</mml:mi></mml:mrow><mml:mrow><mml:mi>j</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mi>θ</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msubsup></mml:mrow></mml:msup></mml:mrow></mml:mfrac><mml:mspace width="1.0em"/></mml:mtd><mml:mtd columnalign="left"><mml:mi mathvariant="normal">if</mml:mi><mml:mspace width="0.25em"/><mml:mi mathvariant="normal">output</mml:mi><mml:mspace width="0.25em"/><mml:mi mathvariant="normal">unit</mml:mi><mml:mspace width="0.25em"/><mml:mi>o</mml:mi><mml:mspace width="0.25em"/><mml:mi mathvariant="normal">is</mml:mi><mml:mspace width="0.25em"/><mml:mi mathvariant="normal">active</mml:mi></mml:mtd></mml:mtr><mml:mtr><mml:mtd columnalign="left"><mml:mi mathvariant="normal">0</mml:mi><mml:mspace width="1.0em"/></mml:mtd><mml:mtd columnalign="left"><mml:mi mathvariant="normal">otherwise</mml:mi></mml:mtd></mml:mtr></mml:mtable></mml:mrow></mml:mfenced></mml:mrow></mml:math><tex-math id="Equ2_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${p}_{{{{{\theta }}}}}\left(o| {{{{x}}}}\right)=\left\{\begin{array}{ll}\frac{{e}^{{z}_{o}^{({{{{x}}}},{{{{\theta }}}})}}}{{\sum }_{j}{e}^{{z}_{j}^{({{{{x}}}},{{{{\theta }}}})}}}\quad &amp;{{{\rm{if}}}}\,{{{\rm{output}}}}\,{{{\rm{unit}}}}\,o\,{{{\rm{is}}}}\,{{{\rm{active}}}}\\ {{{\rm{0}}}}\quad &amp;{{{\rm{otherwise}}}}\end{array}\right.$$\end{document}</tex-math><graphic position="anchor" xlink:href="42256_2022_568_Article_Equ2.gif"/></alternatives></disp-formula>whereby <inline-formula id="IEq31"><alternatives><mml:math><mml:msubsup><mml:mrow><mml:mi>z</mml:mi></mml:mrow><mml:mrow><mml:mi>o</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mi>θ</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msubsup></mml:math><tex-math id="IEq31_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${z}_{o}^{({{{{x}}}},{{{{\theta }}}})}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq31.gif"/></alternatives></inline-formula> was the logit of output class <italic>o</italic> obtained by putting input <italic>x</italic> through the neural network with parameters <italic>θ</italic>. The summation in the denominator was over all active classes in the output layer. Importantly, with task- and class-incremental learning, output class <italic>o</italic> refers to the ‘global class’ that is obtained by combining the within-context label <italic>y</italic> and the context label <italic>c</italic> (that is, the set of global classes is given by <inline-formula id="IEq32"><alternatives><mml:math><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">G</mml:mi><mml:mo>=</mml:mo><mml:mi class="MJX-tex-caligraphic" mathvariant="script">Y</mml:mi><mml:mo>×</mml:mo><mml:mi class="MJX-tex-caligraphic" mathvariant="script">C</mml:mi></mml:mrow></mml:math><tex-math id="IEq32_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{\mathcal{G}}}}={{{\mathcal{Y}}}}\times {{{\mathcal{C}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq32.gif"/></alternatives></inline-formula>). With domain-incremental learning, output class <italic>o</italic> refers to the within-context label <italic>y</italic>.</p></sec><sec id="Sec15"><title>Data stream</title><p id="Par49">All experiments in this article used the academic continual learning setting, meaning that the different contexts were presented to the algorithm one after the other. Within each context, the training data was fed to the algorithm in a stream of independent and identically distributed experiences (or iterations). For Split MNIST, each context was trained for 2,000 iterations with mini-batch size of 128. For Split CIFAR-100, there were 5,000 iterations per context with mini-batch size of 256. Some of the compared methods (EWC, FROMP and iCaRL) performed an additional pass over each context’s training data upon finishing training on that context.</p></sec><sec id="Sec16"><title>Loss function and optimization</title><p id="Par50">For all compared methods, the parameters of the neural network were sequentially trained on each context by optimizing a loss function (denoted by <inline-formula id="IEq33"><alternatives><mml:math><mml:msub><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">total</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="IEq33_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\mathcal{L}}}}}_{{{{\rm{total}}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq33.gif"/></alternatives></inline-formula>) using stochastic gradient descent. In each iteration, the loss was calculated as the average over all samples in the mini-batch and a single gradient step was taken with the ADAM-optimizer (<italic>β</italic><sub>1</sub> = 0.9, <italic>β</italic><sub>2</sub> = 0.999; ref. <sup><xref ref-type="bibr" rid="CR70">70</xref></sup>) and a learning rate of either 0.001 (Split MNIST) or 0.0001 (Split CIFAR-100).</p><p id="Par51">For most compared methods, a central component of the loss function was the multi-class cross-entropy classification loss on the data of the current context. For an input <italic>x</italic> labeled with a hard target <italic>o</italic>, this classification loss was given by:<disp-formula id="Equ3"><label>3</label><alternatives><mml:math><mml:mrow><mml:msup><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">C</mml:mi></mml:mrow></mml:msup><mml:mfenced close=")" open="("><mml:mrow><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mi>o</mml:mi><mml:mo>;</mml:mo><mml:mi>θ</mml:mi></mml:mrow></mml:mfenced><mml:mo>=</mml:mo><mml:mo>−</mml:mo><mml:mi>log</mml:mi><mml:msub><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>θ</mml:mi></mml:mrow></mml:msub><mml:mfenced close=")" open="("><mml:mrow><mml:mi>o</mml:mi><mml:mo>∣</mml:mo><mml:mi>x</mml:mi></mml:mrow></mml:mfenced></mml:mrow></mml:math><tex-math id="Equ3_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\mathcal{L}}}}}^{{{{\rm{C}}}}}\left({{{{x}}}},o;{{{{\theta }}}}\right)=-\log {p}_{{{{{\theta }}}}}\left(o| {{{{x}}}}\right)$$\end{document}</tex-math><graphic position="anchor" xlink:href="42256_2022_568_Article_Equ3.gif"/></alternatives></disp-formula>with <italic>p</italic><sub><bold><italic>θ</italic></bold></sub> the conditional probability distribution defined by the neural network with parameters <italic>θ</italic>, as given in equation (<xref rid="Equ2" ref-type="disp-formula">2</xref>).</p></sec><sec id="Sec17"><title>Memory buffer and generative models</title><p id="Par52">Several of the compared methods (FROMP, ER, A-GEM and iCaRL) maintained a memory buffer in which examples of previously seen classes were stored. Except for the experiments in Extended Data Fig. <xref rid="Fig1" ref-type="fig">1</xref>, 100 examples per class were allowed to be stored in the memory buffer (that is, the per-class memory budget <italic>B</italic> was set to 100). Some other methods (DGR, BI-R and the Generative Classifier) learned generative models, these methods used up to three times as many parameters compared with the other methods.</p></sec><sec id="Sec18"><title>Baselines</title><p id="Par53">For the baseline ‘None’, which was included as a lower target, the base neural network was sequentially trained on each context in the standard way, meaning that the loss function to be optimized was always just the classification loss on the current data (that is, <inline-formula id="IEq34"><alternatives><mml:math><mml:mrow><mml:msub><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">total</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:msup><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">C</mml:mi></mml:mrow></mml:msup></mml:mrow></mml:math><tex-math id="IEq34_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\mathcal{L}}}}}_{{{{\rm{total}}}}}={{{{\mathcal{L}}}}}^{{{{\rm{C}}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq34.gif"/></alternatives></inline-formula>).</p><p id="Par54">For the baseline ‘Joint’, which was included as an upper target, the base neural network was trained on the data from all contexts at the same time. For this baseline, the same total number of iterations was used as with the sequential training protocol (that is, 5×2,000 iterations for Split MNIST and 10×5,000 iterations for Split CIFAR), but each mini-batch was always sampled jointly from the data of all contexts.</p></sec><sec id="Sec19"><title>Approaches using context-specific components</title><p id="Par55">For XdG and the ‘Separate Networks’ approach, not all parts of the network were used for each context. These approaches require knowledge of which context a sample belongs to (to select the correct context-specific components), which meant that they could only be used in the task-incremental learning scenario. For both approaches, training was performed using just the classification loss on the current data (that is, <inline-formula id="IEq35"><alternatives><mml:math><mml:mrow><mml:msub><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">total</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:msup><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">C</mml:mi></mml:mrow></mml:msup></mml:mrow></mml:math><tex-math id="IEq35_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\mathcal{L}}}}}_{{{{\rm{total}}}}}={{{{\mathcal{L}}}}}^{{{{\rm{C}}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq35.gif"/></alternatives></inline-formula>).</p><p id="Par56">In the task-incremental learning scenario, the other methods (that is, all methods except XdG and Separate Networks) used the available context identity information only in the form of a separate output layer for each context. This is a common and often sensible way to use context identity information, although in Supplementary Note <xref ref-type="supplementary-material" rid="MOESM1">7</xref> we show that sometimes it is more efficient to use context identity information in other ways.</p><sec id="Sec20"><title>Separate Networks</title><p id="Par57">For the Separate Networks approach, the available parameter budget was equally divided over all contexts to be learned, and a separate sub-network was trained for each context. For Split MNIST, each context-specific sub-network had two fully connected hidden layers of 100 ReLU each and a softmax output layer. For Split CIFAR-100, the pre-trained and frozen convolutional layers were shared between all contexts, and only the fully connected part of the network was split up into context-specific sub-networks. Each context-specific sub-network had two fully connected layers with 400 ReLU each and a softmax output layer.</p></sec><sec id="Sec21"><title>XdG</title><p id="Par58">With XdG<sup><xref ref-type="bibr" rid="CR12">12</xref></sup>, the base neural network was used and for each context a different, randomly selected subset of <italic>X</italic>% of the units in each hidden layer was fully gated (that is, their activations were set to zero), with <italic>X</italic> a hyperparameter whose value was set by a grid search (Supplementary Note <xref ref-type="supplementary-material" rid="MOESM1">8</xref>).</p></sec></sec><sec id="Sec22"><title>Parameter regularization methods</title><p id="Par59">For the parameter regularization methods EWC and SI, a regularization term was added to the classification loss: <inline-formula id="IEq36"><alternatives><mml:math><mml:mrow><mml:msub><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">total</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:msup><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">C</mml:mi></mml:mrow></mml:msup><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">param-reg</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math><tex-math id="IEq36_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\mathcal{L}}}}}_{{{{\rm{total}}}}}={{{{\mathcal{L}}}}}^{{{{\rm{C}}}}}+{{{{\mathcal{L}}}}}_{{{{\rm{param-reg}}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq36.gif"/></alternatives></inline-formula>. This regularization term penalized changes to parameters thought to be important for previously learned contexts.</p><sec id="Sec23"><title>EWC</title><p id="Par60">The regularization term of EWC<sup><xref ref-type="bibr" rid="CR49">49</xref></sup> consisted of a quadratic penalty term for each previously learned context, whereby the term of each context penalized parameters for how different they were compared to their value directly after finishing training on that context. When training on context <italic>K</italic> &gt; 1, the EWC regularization term was given by:<disp-formula id="Equ4"><label>4</label><alternatives><mml:math><mml:mrow><mml:msubsup><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">param-reg</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>K</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msubsup><mml:mfenced close=")" open="("><mml:mrow><mml:mi>θ</mml:mi></mml:mrow></mml:mfenced><mml:mo>=</mml:mo><mml:mi>λ</mml:mi><mml:munderover accent="false" accentunder="false"><mml:mrow><mml:mo>∑</mml:mo></mml:mrow><mml:mrow><mml:mi>k</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>K</mml:mi><mml:mo>−</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:munderover><mml:mfenced close=")" open="("><mml:mrow><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:mfrac><mml:munderover accent="false" accentunder="false"><mml:mrow><mml:mo>∑</mml:mo></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>N</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">params</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:munderover><mml:msubsup><mml:mrow><mml:mi>F</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mi>i</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>k</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msubsup><mml:msup><mml:mrow><mml:mfenced close=")" open="("><mml:mrow><mml:msub><mml:mrow><mml:mi>θ</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>−</mml:mo><mml:msubsup><mml:mrow><mml:mover accent="true"><mml:mrow><mml:mi>θ</mml:mi></mml:mrow><mml:mrow><mml:mo>̂</mml:mo></mml:mrow></mml:mover></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>k</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msubsup></mml:mrow></mml:mfenced></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:mfenced></mml:mrow></mml:math><tex-math id="Equ4_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\mathcal{L}}}}}_{{{{\rm{param-reg}}}}}^{(K)}\left({{{{\theta }}}}\right)=\lambda \mathop{\sum }\limits_{k=1}^{K-1}\left(\frac{1}{2}\mathop{\sum }\limits_{i=1}^{{N}_{{{{\rm{params}}}}}}{F}_{ii}^{(k)}{\left({\theta }_{i}-{\hat{\theta }}_{i}^{(k)}\right)}^{2}\right)$$\end{document}</tex-math><graphic position="anchor" xlink:href="42256_2022_568_Article_Equ4.gif"/></alternatives></disp-formula>with <italic>λ</italic> a hyperparameter controlling the regularization strength (which was set based on a grid search, Supplementary Note <xref ref-type="supplementary-material" rid="MOESM1">8</xref>), <inline-formula id="IEq37"><alternatives><mml:math><mml:msubsup><mml:mrow><mml:mover accent="true"><mml:mrow><mml:mi>θ</mml:mi></mml:mrow><mml:mrow><mml:mo>̂</mml:mo></mml:mrow></mml:mover></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>k</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msubsup></mml:math><tex-math id="IEq37_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${\hat{\theta }}_{i}^{(k)}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq37.gif"/></alternatives></inline-formula> the value of the <italic>i</italic><sup>th</sup> parameter at the end of training on context <italic>k</italic>, and <inline-formula id="IEq38"><alternatives><mml:math><mml:msubsup><mml:mrow><mml:mi>F</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mi>i</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>k</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msubsup></mml:math><tex-math id="IEq38_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${F}_{ii}^{(k)}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq38.gif"/></alternatives></inline-formula> the estimated importance of parameter <italic>i</italic> for context <italic>k</italic>. This importance estimate was calculated as the <italic>i</italic><sup>th</sup> diagonal element of the Fisher information matrix of context <italic>k</italic>:<disp-formula id="Equ5"><label>5</label><alternatives><mml:math><mml:mrow><mml:msubsup><mml:mrow><mml:mi>F</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mi>i</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>k</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msubsup><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mo>∣</mml:mo><mml:msup><mml:mrow><mml:mi>S</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>k</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msup><mml:mo>∣</mml:mo></mml:mrow></mml:mfrac><mml:munder><mml:mrow><mml:mo>∑</mml:mo></mml:mrow><mml:mrow><mml:mi>x</mml:mi><mml:mo>∈</mml:mo><mml:msup><mml:mrow><mml:mi>S</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>k</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msup></mml:mrow></mml:munder><mml:mfenced close=")" open="("><mml:mrow><mml:munder><mml:mrow><mml:mo>∑</mml:mo></mml:mrow><mml:mrow><mml:mi>o</mml:mi></mml:mrow></mml:munder><mml:msubsup><mml:mrow><mml:mover accent="true"><mml:mrow><mml:mi>o</mml:mi></mml:mrow><mml:mrow><mml:mo>̂</mml:mo></mml:mrow></mml:mover></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow><mml:mrow><mml:mfenced close=")" open="("><mml:mrow><mml:mi>x</mml:mi></mml:mrow></mml:mfenced></mml:mrow></mml:msubsup><mml:msup><mml:mrow><mml:mfenced close=")" open="("><mml:mrow><mml:msub><mml:mrow><mml:mfenced close="∣"><mml:mrow><mml:mfrac><mml:mrow><mml:mi>δ</mml:mi><mml:mi>log</mml:mi><mml:msub><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>θ</mml:mi></mml:mrow></mml:msub><mml:mfenced close=")" open="("><mml:mrow><mml:mi>o</mml:mi><mml:mo>∣</mml:mo><mml:mi>x</mml:mi></mml:mrow></mml:mfenced></mml:mrow><mml:mrow><mml:mi>δ</mml:mi><mml:msub><mml:mrow><mml:mi>θ</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfrac></mml:mrow></mml:mfenced></mml:mrow><mml:mrow><mml:mi>θ</mml:mi><mml:mo>=</mml:mo><mml:msup><mml:mrow><mml:mover accent="true"><mml:mrow><mml:mi>θ</mml:mi></mml:mrow><mml:mrow><mml:mo>̂</mml:mo></mml:mrow></mml:mover></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>k</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msup></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:mfenced></mml:mrow></mml:math><tex-math id="Equ5_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${F}_{ii}^{(k)}=\frac{1}{| {S}^{(k)}| }\mathop{\sum}\limits_{{{{{x}}}}\in {S}^{(k)}}\left(\mathop{\sum}\limits_{o}{\hat{o}}_{k}^{\left({{{{x}}}}\right)}{\left({\left.\frac{\delta \log {p}_{{{{{\theta }}}}}\left(o| {{{{x}}}}\right)}{\delta {\theta }_{i}}\right|}_{{{{{\theta }}}} = {\hat{{{{{\theta }}}}}}^{(k)}}\right)}^{2}\right)$$\end{document}</tex-math><graphic position="anchor" xlink:href="42256_2022_568_Article_Equ5.gif"/></alternatives></disp-formula>whereby <italic>S</italic><sup>(<italic>k</italic>)</sup> was the training data of context <italic>k</italic> and <inline-formula id="IEq39"><alternatives><mml:math><mml:msubsup><mml:mrow><mml:mover accent="true"><mml:mrow><mml:mi>o</mml:mi></mml:mrow><mml:mrow><mml:mo>̂</mml:mo></mml:mrow></mml:mover></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow><mml:mrow><mml:mfenced close=")" open="("><mml:mrow><mml:mi>x</mml:mi></mml:mrow></mml:mfenced></mml:mrow></mml:msubsup></mml:math><tex-math id="IEq39_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${\hat{o}}_{k}^{\left({{{{x}}}}\right)}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq39.gif"/></alternatives></inline-formula> was the probability that <italic>x</italic> belongs to output class <italic>o</italic>, as predicted by the network after finishing training on context <italic>k</italic>—that is, <inline-formula id="IEq40"><alternatives><mml:math><mml:mrow><mml:msubsup><mml:mrow><mml:mover accent="true"><mml:mrow><mml:mi>o</mml:mi></mml:mrow><mml:mrow><mml:mo>̂</mml:mo></mml:mrow></mml:mover></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow><mml:mrow><mml:mfenced close=")" open="("><mml:mrow><mml:mi>x</mml:mi></mml:mrow></mml:mfenced></mml:mrow></mml:msubsup><mml:mo>=</mml:mo><mml:msub><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:msup><mml:mrow><mml:mover accent="true"><mml:mrow><mml:mi>θ</mml:mi></mml:mrow><mml:mrow><mml:mo>̂</mml:mo></mml:mrow></mml:mover></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>k</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msup></mml:mrow></mml:msub><mml:mfenced close=")" open="("><mml:mrow><mml:mi>o</mml:mi><mml:mo>∣</mml:mo><mml:mi>x</mml:mi></mml:mrow></mml:mfenced></mml:mrow></mml:math><tex-math id="IEq40_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${\hat{o}}_{k}^{\left({{{{x}}}}\right)}={p}_{{\hat{{{{{\theta }}}}}}^{(k)}}\left(o| {{{{x}}}}\right)$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq40.gif"/></alternatives></inline-formula>. The inner summation in equation (<xref rid="Equ5" ref-type="disp-formula">5</xref>) was over all output classes that were active during training on context <italic>k</italic>.</p></sec><sec id="Sec24"><title>SI</title><p id="Par61">The regularization term of SI (ref. <sup><xref ref-type="bibr" rid="CR31">31</xref></sup>) consisted of a single quadratic term that penalized changes to the parameters away from the value they had after finishing training on the previous context. When training on context <italic>K</italic> &gt; 1, the SI regularization term was given by:<disp-formula id="Equ6"><label>6</label><alternatives><mml:math><mml:mrow><mml:msubsup><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">param-reg</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>K</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msubsup><mml:mfenced close=")" open="("><mml:mrow><mml:mi>θ</mml:mi></mml:mrow></mml:mfenced><mml:mo>=</mml:mo><mml:mi>γ</mml:mi><mml:munderover accent="false" accentunder="false"><mml:mrow><mml:mo>∑</mml:mo></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>N</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">params</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:munderover><mml:msubsup><mml:mrow><mml:mi mathvariant="normal">Ω</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>K</mml:mi><mml:mo>−</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msubsup><mml:msup><mml:mrow><mml:mfenced close=")" open="("><mml:mrow><mml:msub><mml:mrow><mml:mi>θ</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>−</mml:mo><mml:msubsup><mml:mrow><mml:mover accent="true"><mml:mrow><mml:mi>θ</mml:mi></mml:mrow><mml:mrow><mml:mo>̂</mml:mo></mml:mrow></mml:mover></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow><mml:mrow><mml:mo>*</mml:mo></mml:mrow></mml:msubsup></mml:mrow></mml:mfenced></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math><tex-math id="Equ6_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\mathcal{L}}}}}_{{{{\rm{param-reg}}}}}^{(K)}\left({{{{\theta }}}}\right)=\gamma \mathop{\sum }\limits_{i=1}^{{N}_{{{{\rm{params}}}}}}{{{\Omega }}}_{i}^{(K-1)}{\left({\theta }_{i}-{\hat{\theta }}_{i}^{* }\right)}^{2}$$\end{document}</tex-math><graphic position="anchor" xlink:href="42256_2022_568_Article_Equ6.gif"/></alternatives></disp-formula>with <italic>γ</italic> a hyperparameter controlling the regularization strength (which was set based on a grid search, see Supplementary Note <xref ref-type="supplementary-material" rid="MOESM1">8</xref>), <inline-formula id="IEq41"><alternatives><mml:math><mml:msubsup><mml:mrow><mml:mover accent="true"><mml:mrow><mml:mi>θ</mml:mi></mml:mrow><mml:mrow><mml:mo>̂</mml:mo></mml:mrow></mml:mover></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow><mml:mrow><mml:mo>*</mml:mo></mml:mrow></mml:msubsup></mml:math><tex-math id="IEq41_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${\hat{\theta }}_{i}^{* }$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq41.gif"/></alternatives></inline-formula> the value of the <italic>i</italic><sup>th</sup> parameter at the end of training on context <italic>K</italic> − 1, and <inline-formula id="IEq42"><alternatives><mml:math><mml:msubsup><mml:mrow><mml:mi mathvariant="normal">Ω</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>K</mml:mi><mml:mo>−</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msubsup></mml:math><tex-math id="IEq42_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{\Omega }}}_{i}^{(K-1)}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq42.gif"/></alternatives></inline-formula> the estimated importance of parameter <italic>i</italic> after the first <italic>K</italic> − 1 contexts have been learned. To compute these parameter importance estimates, after each context <italic>k</italic>, a per-parameter contribution to the change of the loss was calculated for each parameter <italic>i</italic> as follows:<disp-formula id="Equ7"><label>7</label><alternatives><mml:math><mml:mrow><mml:msubsup><mml:mrow><mml:mi>ω</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>k</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msubsup><mml:mo>=</mml:mo><mml:munderover accent="false" accentunder="false"><mml:mrow><mml:mo>∑</mml:mo></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>N</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">iters</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:munderover><mml:mfenced close=")" open="("><mml:mrow><mml:msub><mml:mrow><mml:mi>θ</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo>[</mml:mo><mml:mrow><mml:msup><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>k</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msup></mml:mrow><mml:mo>]</mml:mo></mml:mrow><mml:mo>−</mml:mo><mml:msub><mml:mrow><mml:mi>θ</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo>[</mml:mo><mml:mrow><mml:msup><mml:mrow><mml:mfenced close=")" open="("><mml:mrow><mml:mi>t</mml:mi><mml:mo>−</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:mfenced></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>k</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msup></mml:mrow><mml:mo>]</mml:mo></mml:mrow></mml:mrow></mml:mfenced><mml:mfrac><mml:mrow><mml:mo>−</mml:mo><mml:mi>δ</mml:mi><mml:msub><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">total</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo>[</mml:mo><mml:mrow><mml:msup><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>k</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msup></mml:mrow><mml:mo>]</mml:mo></mml:mrow></mml:mrow><mml:mrow><mml:mi>δ</mml:mi><mml:msub><mml:mrow><mml:mi>θ</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfrac></mml:mrow></mml:math><tex-math id="Equ7_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${\omega }_{i}^{(k)}=\mathop{\sum }\limits_{t=1}^{{N}_{{{{\rm{iters}}}}}}\left({\theta }_{i}[{t}^{(k)}]-{\theta }_{i}[{\left(t-1\right)}^{(k)}]\right)\frac{-\delta {{{{\mathcal{L}}}}}_{{{{\rm{total}}}}}[{t}^{(k)}]}{\delta {\theta }_{i}}$$\end{document}</tex-math><graphic position="anchor" xlink:href="42256_2022_568_Article_Equ7.gif"/></alternatives></disp-formula>with <italic>N</italic><sub>iters</sub> the number of iterations per context, <italic>θ</italic><sub><italic>i</italic></sub>[<italic>t</italic><sup>(<italic>k</italic>)</sup>] the value of parameter <italic>i</italic> after the <italic>t</italic><sup>th</sup> training iteration on context <italic>k</italic> and <inline-formula id="IEq43"><alternatives><mml:math><mml:mfrac><mml:mrow><mml:mi>δ</mml:mi><mml:msub><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">total</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo>[</mml:mo><mml:mrow><mml:msup><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>k</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msup></mml:mrow><mml:mo>]</mml:mo></mml:mrow></mml:mrow><mml:mrow><mml:mi>δ</mml:mi><mml:msub><mml:mrow><mml:mi>θ</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfrac></mml:math><tex-math id="IEq43_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$$\frac{\delta {{{{\mathcal{L}}}}}_{{{{\rm{total}}}}}[{t}^{(k)}]}{\delta {\theta }_{i}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq43.gif"/></alternatives></inline-formula> the gradient of the loss with respect to parameter <italic>i</italic> during the <italic>t</italic><sup>th</sup> training iteration on context <italic>k</italic>. For every context, these per-parameter contributions were normalized by the square of the total change of that parameter during training on that context plus a small dampening term <italic>ξ</italic> (set to 0.1, to bound the resulting normalized contributions when a parameter’s total change goes to zero), after which they were summed over all contexts so far:<disp-formula id="Equ8"><label>8</label><alternatives><mml:math><mml:mrow><mml:msubsup><mml:mrow><mml:mi mathvariant="normal">Ω</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>K</mml:mi><mml:mo>−</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msubsup><mml:mo>=</mml:mo><mml:munderover accent="false" accentunder="false"><mml:mrow><mml:mo>∑</mml:mo></mml:mrow><mml:mrow><mml:mi>k</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>K</mml:mi><mml:mo>−</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:munderover><mml:mfrac><mml:mrow><mml:msubsup><mml:mrow><mml:mi>ω</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>k</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msubsup></mml:mrow><mml:mrow><mml:msup><mml:mrow><mml:mfenced close=")" open="("><mml:mrow><mml:msubsup><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>k</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msubsup></mml:mrow></mml:mfenced></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msup><mml:mo>+</mml:mo><mml:mi>ξ</mml:mi></mml:mrow></mml:mfrac></mml:mrow></mml:math><tex-math id="Equ8_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{\Omega }}}_{i}^{(K-1)}=\mathop{\sum }\limits_{k=1}^{K-1}\frac{{\omega }_{i}^{(k)}}{{\left({{{\Delta }}}_{i}^{(k)}\right)}^{2}+\xi }$$\end{document}</tex-math><graphic position="anchor" xlink:href="42256_2022_568_Article_Equ8.gif"/></alternatives></disp-formula>with <inline-formula id="IEq44"><alternatives><mml:math><mml:mrow><mml:msubsup><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>k</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msubsup><mml:mo>=</mml:mo><mml:msub><mml:mrow><mml:mi>θ</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo>[</mml:mo><mml:mrow><mml:msup><mml:mrow><mml:msub><mml:mrow><mml:mi>N</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">iters</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>k</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msup></mml:mrow><mml:mo>]</mml:mo></mml:mrow><mml:mo>−</mml:mo><mml:msub><mml:mrow><mml:mi>θ</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo>[</mml:mo><mml:mrow><mml:msup><mml:mrow><mml:mn>0</mml:mn></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>k</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msup></mml:mrow><mml:mo>]</mml:mo></mml:mrow></mml:mrow></mml:math><tex-math id="IEq44_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{\Delta }}}_{i}^{(k)}={\theta }_{i}[{{N}_{{{{\rm{iters}}}}}}^{(k)}]-{\theta }_{i}[{0}^{(k)}]$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq44.gif"/></alternatives></inline-formula>, where <italic>θ</italic><sub><italic>i</italic></sub>[0<sup>(<italic>k</italic>)</sup>] was the value of parameter <italic>i</italic> right before starting training on context <italic>k</italic>.</p></sec></sec><sec id="Sec25"><title>Functional regularization methods</title><p id="Par62">Similar as with parameter regularization, the functional regularization methods LwF and FROMP had a regularization term added to the classification loss: <inline-formula id="IEq45"><alternatives><mml:math><mml:mrow><mml:msub><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">total</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:msup><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">C</mml:mi></mml:mrow></mml:msup><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">func-reg</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math><tex-math id="IEq45_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\mathcal{L}}}}}_{{{{\rm{total}}}}}={{{{\mathcal{L}}}}}^{{{{\rm{C}}}}}+{{{{\mathcal{L}}}}}_{{{{\rm{func-reg}}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq45.gif"/></alternatives></inline-formula>. This regularization term encouraged the input–output mapping of the network not to change too much at a set of anchor points.</p><sec id="Sec26"><title>LwF</title><p id="Par63">The method LwF (ref. <sup><xref ref-type="bibr" rid="CR50">50</xref></sup>) used the inputs from the current context as anchor points in combination with knowledge distillation<sup><xref ref-type="bibr" rid="CR71">71</xref></sup>. During training on context <italic>K</italic> &gt; 1, the LwF regularization term was given by:<disp-formula id="Equ9"><label>9</label><alternatives><mml:math><mml:mrow><mml:msubsup><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">func-reg</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>K</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msubsup><mml:mfenced close=")" open="("><mml:mrow><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mi>θ</mml:mi></mml:mrow></mml:mfenced><mml:mo>=</mml:mo><mml:mo>−</mml:mo><mml:munderover accent="false" accentunder="false"><mml:mrow><mml:mo>∑</mml:mo></mml:mrow><mml:mrow><mml:mi>k</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>K</mml:mi><mml:mo>−</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:munderover><mml:munder><mml:mrow><mml:mo>∑</mml:mo></mml:mrow><mml:mrow><mml:mi>o</mml:mi><mml:mo>∈</mml:mo><mml:msub><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">O</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:munder><mml:msubsup><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:msup><mml:mrow><mml:mover accent="true"><mml:mrow><mml:mi>θ</mml:mi></mml:mrow><mml:mrow><mml:mo>̂</mml:mo></mml:mrow></mml:mover></mml:mrow><mml:mrow><mml:mo>*</mml:mo></mml:mrow></mml:msup></mml:mrow><mml:mrow><mml:mi>T</mml:mi></mml:mrow></mml:msubsup><mml:mfenced close=")" open="("><mml:mrow><mml:mi>o</mml:mi><mml:mo>∣</mml:mo><mml:mi>x</mml:mi></mml:mrow></mml:mfenced><mml:mi>log</mml:mi><mml:mfenced close="]" open="["><mml:mrow><mml:msubsup><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>θ</mml:mi></mml:mrow><mml:mrow><mml:mi>T</mml:mi></mml:mrow></mml:msubsup><mml:mfenced close=")" open="("><mml:mrow><mml:mi>o</mml:mi><mml:mo>∣</mml:mo><mml:mi>x</mml:mi></mml:mrow></mml:mfenced></mml:mrow></mml:mfenced></mml:mrow></mml:math><tex-math id="Equ9_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\mathcal{L}}}}}_{{{{\rm{func-reg}}}}}^{(K)}\left({{{{x}}}},{{{{\theta }}}}\right)=-\mathop{\sum }\limits_{k=1}^{K-1}\mathop{\sum}\limits_{o\in {{{{\mathcal{O}}}}}_{k}}{p}_{{\hat{{{{{\theta }}}}}}^{* }}^{T}\left(o| {{{{x}}}}\right)\log \left[{p}_{{{{{\theta }}}}}^{T}\left(o| {{{{x}}}}\right)\right]$$\end{document}</tex-math><graphic position="anchor" xlink:href="42256_2022_568_Article_Equ9.gif"/></alternatives></disp-formula>whereby <inline-formula id="IEq46"><alternatives><mml:math><mml:msub><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">O</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="IEq46_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\mathcal{O}}}}}_{k}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq46.gif"/></alternatives></inline-formula> was the set of output classes in context <italic>k</italic>, <inline-formula id="IEq47"><alternatives><mml:math><mml:msup><mml:mrow><mml:mover accent="true"><mml:mrow><mml:mi>θ</mml:mi></mml:mrow><mml:mrow><mml:mo>̂</mml:mo></mml:mrow></mml:mover></mml:mrow><mml:mrow><mml:mo>*</mml:mo></mml:mrow></mml:msup></mml:math><tex-math id="IEq47_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${\hat{{{{{\theta }}}}}}^{* }$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq47.gif"/></alternatives></inline-formula> was the parameter vector with values as they were at the end of training on context <italic>K</italic> − 1 and <inline-formula id="IEq48"><alternatives><mml:math><mml:mrow><mml:msubsup><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>θ</mml:mi></mml:mrow><mml:mrow><mml:mi>T</mml:mi></mml:mrow></mml:msubsup><mml:mfenced close=")" open="("><mml:mrow><mml:mi>o</mml:mi><mml:mo>∣</mml:mo><mml:mi>x</mml:mi></mml:mrow></mml:mfenced></mml:mrow></mml:math><tex-math id="IEq48_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${p}_{{{{{\theta }}}}}^{T}\left(o| {{{{x}}}}\right)$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq48.gif"/></alternatives></inline-formula> was the ‘temperature-raised’ probability that input <bold><italic>x</italic></bold> belongs to output class <italic>o</italic>, as predicted by the network with parameters <italic>θ</italic>. These temperature-raised probabilities were defined as:<disp-formula id="Equ10"><label>10</label><alternatives><mml:math><mml:mrow><mml:msubsup><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>θ</mml:mi></mml:mrow><mml:mrow><mml:mi>T</mml:mi></mml:mrow></mml:msubsup><mml:mfenced close=")" open="("><mml:mrow><mml:mi>o</mml:mi><mml:mo>∣</mml:mo><mml:mi>x</mml:mi></mml:mrow></mml:mfenced><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:mi>exp</mml:mi><mml:mfenced close="]" open="["><mml:mrow><mml:msubsup><mml:mrow><mml:mi>z</mml:mi></mml:mrow><mml:mrow><mml:mi>o</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mi>θ</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msubsup><mml:mo>/</mml:mo><mml:mi>T</mml:mi></mml:mrow></mml:mfenced></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mo mathsize="big">∑</mml:mo></mml:mrow><mml:mrow><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mi>exp</mml:mi><mml:mfenced close="]" open="["><mml:mrow><mml:msubsup><mml:mrow><mml:mi>z</mml:mi></mml:mrow><mml:mrow><mml:mi>j</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mi>θ</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msubsup><mml:mo>/</mml:mo><mml:mi>T</mml:mi></mml:mrow></mml:mfenced></mml:mrow></mml:mfrac></mml:mrow></mml:math><tex-math id="Equ10_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${p}_{{{{{\theta }}}}}^{T}\left(o| {{{{x}}}}\right)=\frac{\exp \left[{z}_{o}^{({{{{x}}}},{{{{\theta }}}})}/T\right]}{{\sum }_{j}\exp \left[{z}_{j}^{({{{{x}}}},{{{{\theta }}}})}/T\right]}$$\end{document}</tex-math><graphic position="anchor" xlink:href="42256_2022_568_Article_Equ10.gif"/></alternatives></disp-formula>with <italic>T</italic> the temperature, which was set to 2, and <inline-formula id="IEq49"><alternatives><mml:math><mml:msubsup><mml:mrow><mml:mi>z</mml:mi></mml:mrow><mml:mrow><mml:mi>o</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mi>θ</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msubsup></mml:math><tex-math id="IEq49_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${z}_{o}^{({{{{x}}}},{{{{\theta }}}})}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq49.gif"/></alternatives></inline-formula> the logit of output class <italic>o</italic> obtained by putting input <bold><italic>x</italic></bold> through the neural network with parameters <italic>θ</italic>. The summation in the denominator was over all active classes in the output layer. With task-incremental learning, for each context’s term in the outer summation of equation (<xref rid="Equ9" ref-type="disp-formula">9</xref>), only the output classes contained in that context were active. With domain- and class-incremental learning, always all output classes were active. In each iteration, the LwF regularization term was computed as average over the same inputs that were used to compute <inline-formula id="IEq50"><alternatives><mml:math><mml:msup><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">C</mml:mi></mml:mrow></mml:msup></mml:math><tex-math id="IEq50_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\mathcal{L}}}}}^{{{{\rm{C}}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq50.gif"/></alternatives></inline-formula>.</p><p id="Par64">We note that this implementation of LwF differs slightly from the implementation of LwF used in ref. <sup><xref ref-type="bibr" rid="CR28">28</xref></sup>. Compared with that implementation, the regularization term here was weighted less strongly, which substantially improved the performance of LwF on Split CIFAR-100. Initial experiments indicated that by reducing the weight of the replay term in equation (<xref rid="Equ16" ref-type="disp-formula">16</xref>) it is also be possible to improve the performance of several of the replay methods on Split CIFAR-100, but at the cost of impaired performance on Split MNIST.</p></sec><sec id="Sec27"><title>FROMP</title><p id="Par65">The method FROMP (ref. <sup><xref ref-type="bibr" rid="CR51">51</xref></sup>) performed functional regularization in a Bayesian framework and used stored data from previous contexts, referred to as memorable inputs, as anchor points. During training on context <italic>K</italic>, the regularization term of FROMP was given by:<disp-formula id="Equ11"><label>11</label><alternatives><mml:math><mml:mrow><mml:msubsup><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">func-reg</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>K</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msubsup><mml:mfenced close=")" open="("><mml:mrow><mml:mi>θ</mml:mi></mml:mrow></mml:mfenced><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:mfrac><mml:mi>τ</mml:mi><mml:munderover accent="false" accentunder="false"><mml:mrow><mml:mo>∑</mml:mo></mml:mrow><mml:mrow><mml:mi>k</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>K</mml:mi><mml:mo>−</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:munderover><mml:munder><mml:mrow><mml:mo>∑</mml:mo></mml:mrow><mml:mrow><mml:mi>o</mml:mi><mml:mo>∈</mml:mo><mml:msub><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">O</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:munder><mml:msup><mml:mrow><mml:mfenced close=")" open="("><mml:mrow><mml:msubsup><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi><mml:mo>,</mml:mo><mml:mi>o</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>θ</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msubsup><mml:mo>−</mml:mo><mml:msubsup><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi><mml:mo>,</mml:mo><mml:mi>o</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msup><mml:mrow><mml:mover accent="true"><mml:mrow><mml:mi>θ</mml:mi></mml:mrow><mml:mrow><mml:mo>̂</mml:mo></mml:mrow></mml:mover></mml:mrow><mml:mrow><mml:mo>*</mml:mo></mml:mrow></mml:msup></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msubsup></mml:mrow></mml:mfenced></mml:mrow><mml:mrow><mml:mi>T</mml:mi></mml:mrow></mml:msup><mml:msup><mml:mrow><mml:msubsup><mml:mrow><mml:mi mathvariant="bold">K</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi><mml:mo>,</mml:mo><mml:mi>o</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>K</mml:mi><mml:mo>−</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msubsup></mml:mrow><mml:mrow><mml:mo>−</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msup><mml:mfenced close=")" open="("><mml:mrow><mml:msubsup><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi><mml:mo>,</mml:mo><mml:mi>o</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>θ</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msubsup><mml:mo>−</mml:mo><mml:msubsup><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi><mml:mo>,</mml:mo><mml:mi>o</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msup><mml:mrow><mml:mover accent="true"><mml:mrow><mml:mi>θ</mml:mi></mml:mrow><mml:mrow><mml:mo>̂</mml:mo></mml:mrow></mml:mover></mml:mrow><mml:mrow><mml:mo>*</mml:mo></mml:mrow></mml:msup></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msubsup></mml:mrow></mml:mfenced></mml:mrow></mml:math><tex-math id="Equ11_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\mathcal{L}}}}}_{{{{\rm{func-reg}}}}}^{(K)}\left({{{{\theta }}}}\right)=\frac{1}{2}\tau \mathop{\sum }\limits_{k=1}^{K-1}\mathop{\sum}\limits_{o\in {{{{\mathcal{O}}}}}_{k}}{\left({{{{{m}}}}}_{k,o}^{({{{{\theta }}}})}-{{{{{m}}}}}_{k,o}^{({\hat{{{{{\theta }}}}}}^{* })}\right)}^{T}{{{{{\bf{K}}}}}_{k,o}^{(K-1)}}^{-1}\left({{{{{m}}}}}_{k,o}^{({{{{\theta }}}})}-{{{{{m}}}}}_{k,o}^{({\hat{{{{{\theta }}}}}}^{* })}\right)$$\end{document}</tex-math><graphic position="anchor" xlink:href="42256_2022_568_Article_Equ11.gif"/></alternatives></disp-formula>with <italic>τ</italic> a hyperparameter controlling the regularization strength (which was set based on a grid search, see Supplementary Note <xref ref-type="supplementary-material" rid="MOESM1">8</xref>) and <inline-formula id="IEq51"><alternatives><mml:math><mml:msup><mml:mrow><mml:mover accent="true"><mml:mrow><mml:mi>θ</mml:mi></mml:mrow><mml:mrow><mml:mo>̂</mml:mo></mml:mrow></mml:mover></mml:mrow><mml:mrow><mml:mo>*</mml:mo></mml:mrow></mml:msup></mml:math><tex-math id="IEq51_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${\hat{{{{{\theta }}}}}}^{* }$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq51.gif"/></alternatives></inline-formula> the parameter vector with values as they were at the end of training on context <italic>K</italic> − 1. Further, <inline-formula id="IEq52"><alternatives><mml:math><mml:msubsup><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi><mml:mo>,</mml:mo><mml:mi>o</mml:mi></mml:mrow><mml:mrow><mml:mfenced close=")" open="("><mml:mrow><mml:mi>θ</mml:mi></mml:mrow></mml:mfenced></mml:mrow></mml:msubsup></mml:math><tex-math id="IEq52_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{{m}}}}}_{k,o}^{\left({{{{\theta }}}}\right)}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq52.gif"/></alternatives></inline-formula> was a vector containing for each memorable input from context <italic>k</italic> the probability that this input belongs to output class <italic>o</italic> as predicted by the network with parameters <italic>θ</italic>. That is, the <italic>i</italic><sup>th</sup> element of <inline-formula id="IEq53"><alternatives><mml:math><mml:msubsup><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi><mml:mo>,</mml:mo><mml:mi>o</mml:mi></mml:mrow><mml:mrow><mml:mfenced close=")" open="("><mml:mrow><mml:mi>θ</mml:mi></mml:mrow></mml:mfenced></mml:mrow></mml:msubsup></mml:math><tex-math id="IEq53_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{{m}}}}}_{k,o}^{\left({{{{\theta }}}}\right)}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq53.gif"/></alternatives></inline-formula> was given by <inline-formula id="IEq54"><alternatives><mml:math><mml:mrow><mml:msubsup><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi><mml:mo>,</mml:mo><mml:mi>o</mml:mi></mml:mrow><mml:mrow><mml:mfenced close=")" open="("><mml:mrow><mml:mi>θ</mml:mi></mml:mrow></mml:mfenced></mml:mrow></mml:msubsup><mml:mrow><mml:mo>[</mml:mo><mml:mrow><mml:mi>i</mml:mi></mml:mrow><mml:mo>]</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:msub><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>θ</mml:mi></mml:mrow></mml:msub><mml:mfenced close=")" open="("><mml:mrow><mml:mi>o</mml:mi><mml:mo>∣</mml:mo><mml:msup><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>k</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msup></mml:mrow></mml:mfenced></mml:mrow></mml:math><tex-math id="IEq54_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{{m}}}}}_{k,o}^{\left({{{{\theta }}}}\right)}[i]={p}_{{{{{\theta }}}}}\left(o| {{{{{x}}}}}^{(i,k)}\right)$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq54.gif"/></alternatives></inline-formula>, with <italic>x</italic><sup>(<italic>i</italic>,<italic>k</italic>)</sup> the <italic>i</italic><sup>th</sup> memorable input of context <italic>k</italic>. Finally, <inline-formula id="IEq55"><alternatives><mml:math><mml:msubsup><mml:mrow><mml:mi mathvariant="bold">K</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi><mml:mo>,</mml:mo><mml:mi>o</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>K</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msubsup></mml:math><tex-math id="IEq55_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\bf{K}}}}}_{k,o}^{(K)}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq55.gif"/></alternatives></inline-formula> was a matrix whose elements were given by:<disp-formula id="Equ12"><label>12</label><alternatives><mml:math><mml:mrow><mml:msubsup><mml:mrow><mml:mi mathvariant="bold">K</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi><mml:mo>,</mml:mo><mml:mi>o</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>K</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msubsup><mml:mrow><mml:mo>[</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi></mml:mrow><mml:mo>]</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:msub><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi><mml:mo>,</mml:mo><mml:mi>o</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo>[</mml:mo><mml:mrow><mml:mi>i</mml:mi></mml:mrow><mml:mo>]</mml:mo></mml:mrow><mml:msup><mml:mrow><mml:mi mathvariant="bold">V</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>K</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msup><mml:msup><mml:mrow><mml:msub><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi><mml:mo>,</mml:mo><mml:mi>o</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo>[</mml:mo><mml:mrow><mml:mi>j</mml:mi></mml:mrow><mml:mo>]</mml:mo></mml:mrow></mml:mrow><mml:mrow><mml:mi>T</mml:mi></mml:mrow></mml:msup></mml:mrow></mml:math><tex-math id="Equ12_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\bf{K}}}}}_{k,o}^{(K)}[i,j]={{{{{g}}}}}_{k,o}[i]{{{{\bf{V}}}}}^{(K)}{{{{{{g}}}}}_{k,o}[j]}^{T}$$\end{document}</tex-math><graphic position="anchor" xlink:href="42256_2022_568_Article_Equ12.gif"/></alternatives></disp-formula>with:<disp-formula id="Equ13"><label>13</label><alternatives><mml:math><mml:mrow><mml:msub><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi><mml:mo>,</mml:mo><mml:mi>o</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo>[</mml:mo><mml:mrow><mml:mi>i</mml:mi></mml:mrow><mml:mo>]</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:msub><mml:mrow><mml:mfenced close="∣"><mml:mrow><mml:mfrac><mml:mrow><mml:mi>δ</mml:mi><mml:msub><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>θ</mml:mi></mml:mrow></mml:msub><mml:mfenced close=")" open="("><mml:mrow><mml:mi>o</mml:mi><mml:mo>∣</mml:mo><mml:msup><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>k</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msup></mml:mrow></mml:mfenced></mml:mrow><mml:mrow><mml:mi>δ</mml:mi><mml:mi>θ</mml:mi></mml:mrow></mml:mfrac></mml:mrow></mml:mfenced></mml:mrow><mml:mrow><mml:mi>θ</mml:mi><mml:mo>=</mml:mo><mml:msup><mml:mrow><mml:mover accent="true"><mml:mrow><mml:mi>θ</mml:mi></mml:mrow><mml:mrow><mml:mo>̂</mml:mo></mml:mrow></mml:mover></mml:mrow><mml:mrow><mml:mo>*</mml:mo></mml:mrow></mml:msup></mml:mrow></mml:msub></mml:mrow></mml:math><tex-math id="Equ13_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{{g}}}}}_{k,o}[i]={\left.\frac{\delta {p}_{{{{{\theta }}}}}\left(o| {{{{{x}}}}}^{(i,k)}\right)}{\delta {{{{\theta }}}}}\right|}_{{{{{\theta }}}} = {\hat{{{{{\theta }}}}}}^{* }}$$\end{document}</tex-math><graphic position="anchor" xlink:href="42256_2022_568_Article_Equ13.gif"/></alternatives></disp-formula>and <bold>V</bold><sup>(<italic>K</italic>)</sup> was a diagonal matrix with diagonal <italic>v</italic><sup>(<italic>K</italic>)</sup> given by:<disp-formula id="Equ14"><label>14</label><alternatives><mml:math><mml:mrow><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msup><mml:mrow><mml:mi>v</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>K</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msup></mml:mrow></mml:mfrac><mml:mo>=</mml:mo><mml:munderover accent="false" accentunder="false"><mml:mrow><mml:mo>∑</mml:mo></mml:mrow><mml:mrow><mml:mi>k</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>K</mml:mi></mml:mrow></mml:munderover><mml:munder><mml:mrow><mml:mo>∑</mml:mo></mml:mrow><mml:mrow><mml:mi>x</mml:mi><mml:mo>∈</mml:mo><mml:msub><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">D</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:munder><mml:mi mathvariant="normal">diag</mml:mi><mml:mfenced close=")" open="("><mml:mrow><mml:msup><mml:mrow><mml:msup><mml:mrow><mml:mi mathvariant="bold">J</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>k</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msup><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow><mml:mrow><mml:mi>T</mml:mi></mml:mrow></mml:msup><mml:msup><mml:mrow><mml:mi mathvariant="normal">Λ</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>k</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msup><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:msup><mml:mrow><mml:mi mathvariant="bold">J</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>k</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msup><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:mfenced></mml:mrow></mml:math><tex-math id="Equ14_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$$\frac{1}{{{{{{v}}}}}^{(K)}}=\mathop{\sum }\limits_{k=1}^{K}\mathop{\sum}\limits_{{{{{x}}}}\in {{{{\mathcal{D}}}}}_{k}}{{{\rm{diag}}}}\left({{{{{\bf{J}}}}}^{(k)}({{{{x}}}})}^{T}{{{{{\Lambda }}}}}^{(k)}({{{{x}}}}){{{{\bf{J}}}}}^{(k)}({{{{x}}}})\right)$$\end{document}</tex-math><graphic position="anchor" xlink:href="42256_2022_568_Article_Equ14.gif"/></alternatives></disp-formula>whereby <inline-formula id="IEq56"><alternatives><mml:math><mml:mrow><mml:msup><mml:mrow><mml:mi mathvariant="bold">J</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>k</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msup><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:msub><mml:mrow><mml:mfenced close="∣"><mml:mrow><mml:mfrac><mml:mrow><mml:mi>δ</mml:mi><mml:msub><mml:mrow><mml:mi>f</mml:mi></mml:mrow><mml:mrow><mml:mi>θ</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow><mml:mrow><mml:mi>δ</mml:mi><mml:mi>θ</mml:mi></mml:mrow></mml:mfrac></mml:mrow></mml:mfenced></mml:mrow><mml:mrow><mml:mi>θ</mml:mi><mml:mo>=</mml:mo><mml:msup><mml:mrow><mml:mover accent="true"><mml:mrow><mml:mi>θ</mml:mi></mml:mrow><mml:mrow><mml:mo>̂</mml:mo></mml:mrow></mml:mover></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>k</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msup></mml:mrow></mml:msub></mml:mrow></mml:math><tex-math id="IEq56_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\bf{J}}}}}^{(k)}({{{{x}}}})={\left.\frac{\delta {{{{{f}}}}}_{{{{{\theta }}}}}({{{{x}}}})}{\delta {{{{\theta }}}}}\right|}_{{{{{\theta }}}} = {\hat{{{{{\theta }}}}}}^{(k)}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq56.gif"/></alternatives></inline-formula>, with <italic>f</italic><sub><italic>θ</italic></sub>(<italic>x</italic>) the logits obtained by putting input <italic>x</italic> through the neural network with parameters <italic>θ</italic>, and <inline-formula id="IEq57"><alternatives><mml:math><mml:mrow><mml:msup><mml:mrow><mml:mi mathvariant="normal">Λ</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>k</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msup><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:mo>[</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi></mml:mrow><mml:mo>]</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:msub><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:msup><mml:mrow><mml:mi>θ</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>k</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msup></mml:mrow></mml:msub><mml:mfenced close=")" open="("><mml:mrow><mml:mi>i</mml:mi><mml:mo>∣</mml:mo><mml:mi>x</mml:mi></mml:mrow></mml:mfenced><mml:mfenced close=")" open="("><mml:mrow><mml:mn>1</mml:mn><mml:mo>−</mml:mo><mml:msub><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:msup><mml:mrow><mml:mi>θ</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>k</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msup></mml:mrow></mml:msub><mml:mfenced close=")" open="("><mml:mrow><mml:mi>j</mml:mi><mml:mo>∣</mml:mo><mml:mi>x</mml:mi></mml:mrow></mml:mfenced></mml:mrow></mml:mfenced><mml:mo>.</mml:mo></mml:mrow></mml:math><tex-math id="IEq57_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{{\Lambda }}}}}^{(k)}({{{{x}}}})[i,j]={p}_{{{{{{\theta }}}}}^{(k)}}\left(i| {{{{x}}}}\right)\left(1-{p}_{{{{{{\theta }}}}}^{(k)}}\left(j| {{{{x}}}}\right)\right).$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq57.gif"/></alternatives></inline-formula></p><p id="Par66">The selection of memorable inputs, which are FROMP’s anchor points, took place after finishing training on each context. After finishing on context <italic>k</italic>, for each input <italic>x</italic> in that context’s training set, a relevance score was calculated as:<disp-formula id="Equ15"><label>15</label><alternatives><mml:math><mml:mrow><mml:mi>r</mml:mi><mml:mfenced close=")" open="("><mml:mrow><mml:mi>x</mml:mi></mml:mrow></mml:mfenced><mml:mo>=</mml:mo><mml:munder><mml:mrow><mml:mo>∑</mml:mo></mml:mrow><mml:mrow><mml:mi>o</mml:mi><mml:mo>∈</mml:mo><mml:msub><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">O</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:munder><mml:msub><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>θ</mml:mi></mml:mrow></mml:msub><mml:mfenced close=")" open="("><mml:mrow><mml:mi>o</mml:mi><mml:mo>∣</mml:mo><mml:mi>x</mml:mi></mml:mrow></mml:mfenced><mml:mfenced close=")" open="("><mml:mrow><mml:mn>1</mml:mn><mml:mo>−</mml:mo><mml:msub><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>θ</mml:mi></mml:mrow></mml:msub><mml:mfenced close=")" open="("><mml:mrow><mml:mi>o</mml:mi><mml:mo>∣</mml:mo><mml:mi>x</mml:mi></mml:mrow></mml:mfenced></mml:mrow></mml:mfenced></mml:mrow></mml:math><tex-math id="Equ15_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$$r\left({{{{x}}}}\right)=\mathop{\sum}\limits_{o\in {{{{\mathcal{O}}}}}_{k}}{p}_{{{{{\theta }}}}}\left(o| {{{{x}}}}\right)\left(1-{p}_{{{{{\theta }}}}}\left(o| {{{{x}}}}\right)\right)$$\end{document}</tex-math><graphic position="anchor" xlink:href="42256_2022_568_Article_Equ15.gif"/></alternatives></disp-formula>whereby <inline-formula id="IEq58"><alternatives><mml:math><mml:msub><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">O</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="IEq58_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\mathcal{O}}}}}_{k}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq58.gif"/></alternatives></inline-formula> was the set of output classes in context <italic>k</italic> and <italic>θ</italic> were the parameters after training on context <italic>k</italic>. Then, for each output class in context <italic>k</italic>, the <italic>B</italic> inputs with the highest relevance scores were selected as the memorable inputs for that class and stored in the memory buffer.</p></sec></sec><sec id="Sec28"><title>Replay-based methods</title><p id="Par67">The replay-based methods had two separate loss terms: one for the data of the current context, denoted as <inline-formula id="IEq59"><alternatives><mml:math><mml:msub><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">current</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="IEq59_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\mathcal{L}}}}}_{{{{\rm{current}}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq59.gif"/></alternatives></inline-formula>, and one for the replayed data, denoted as <inline-formula id="IEq60"><alternatives><mml:math><mml:msub><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">replay</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="IEq60_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\mathcal{L}}}}}_{{{{\rm{replay}}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq60.gif"/></alternatives></inline-formula>. Except with A-GEM, during training the objective was to optimize an overall loss function that was a weighted sum of these two terms, with the weights depending on how many contexts had been seen so far:<disp-formula id="Equ16"><label>16</label><alternatives><mml:math><mml:mrow><mml:msub><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">total</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>N</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">contexts</mml:mi><mml:mspace width="0.25em"/><mml:mi mathvariant="normal">so</mml:mi><mml:mspace width="0.25em"/><mml:mi mathvariant="normal">far</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfrac><mml:msub><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">current</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mn>1</mml:mn><mml:mo>−</mml:mo><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>N</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">contexts</mml:mi><mml:mspace width="0.25em"/><mml:mi mathvariant="normal">so</mml:mi><mml:mspace width="0.25em"/><mml:mi mathvariant="normal">far</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfrac></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:msub><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">replay</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math><tex-math id="Equ16_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\mathcal{L}}}}}_{{{{\rm{total}}}}}=\frac{1}{{N}_{{{{\rm{contexts}}}}\,{{{\rm{so}}}}\,{{{\rm{far}}}}}}{{{{\mathcal{L}}}}}_{{{{\rm{current}}}}}+(1-\frac{1}{{N}_{{{{\rm{contexts}}}}\,{{{\rm{so}}}}\,{{{\rm{far}}}}}}){{{{\mathcal{L}}}}}_{{{{\rm{replay}}}}}$$\end{document}</tex-math><graphic position="anchor" xlink:href="42256_2022_568_Article_Equ16.gif"/></alternatives></disp-formula>In each iteration, the number of replayed samples was always equal to the number of samples from the current context (that is, 128 for Split MNIST and 256 for Split CIFAR-100).</p><sec id="Sec29"><title>ER</title><p id="Par68">With ER, the term <inline-formula id="IEq61"><alternatives><mml:math><mml:msub><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">current</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="IEq61_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\mathcal{L}}}}}_{{{{\rm{current}}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq61.gif"/></alternatives></inline-formula> was the standard classification loss on the data of the current context (that is, <inline-formula id="IEq62"><alternatives><mml:math><mml:mrow><mml:msub><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">current</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:msup><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">C</mml:mi></mml:mrow></mml:msup></mml:mrow></mml:math><tex-math id="IEq62_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\mathcal{L}}}}}_{{{{\rm{current}}}}}={{{{\mathcal{L}}}}}^{{{{\rm{C}}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq62.gif"/></alternatives></inline-formula>). The term <inline-formula id="IEq63"><alternatives><mml:math><mml:msub><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">replay</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="IEq63_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\mathcal{L}}}}}_{{{{\rm{replay}}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq63.gif"/></alternatives></inline-formula> was also the standard classification loss, but on the replayed data. In each iteration, the samples to be replayed were randomly sampled from the memory buffer. The memory buffer was updated after each context, when for each new class <italic>B</italic> samples were randomly selected from the training data and added to the buffer.</p></sec><sec id="Sec30"><title>A-GEM</title><p id="Par69">For the method A-GEM (ref. <sup><xref ref-type="bibr" rid="CR54">54</xref></sup>), the loss terms <inline-formula id="IEq64"><alternatives><mml:math><mml:msub><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">current</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="IEq64_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\mathcal{L}}}}}_{{{{\rm{current}}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq64.gif"/></alternatives></inline-formula> and <inline-formula id="IEq65"><alternatives><mml:math><mml:msub><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">replay</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="IEq65_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\mathcal{L}}}}}_{{{{\rm{replay}}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq65.gif"/></alternatives></inline-formula> were defined similarly as for ER. The population of the memory buffer and sampling of the the data to be replayed from the memory buffer were also the same. The only difference compared to ER was that with A-GEM, the objective was not to minimize the combined loss (that is, <inline-formula id="IEq66"><alternatives><mml:math><mml:msub><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">total</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="IEq66_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\mathcal{L}}}}}_{{{{\rm{total}}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq66.gif"/></alternatives></inline-formula>), but instead the objective was to minimize the loss on the current data (that is, <inline-formula id="IEq67"><alternatives><mml:math><mml:msub><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">current</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="IEq67_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\mathcal{L}}}}}_{{{{\rm{current}}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq67.gif"/></alternatives></inline-formula>) under the constraint that the loss on the replayed data (that is, <inline-formula id="IEq68"><alternatives><mml:math><mml:msub><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">replay</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="IEq68_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\mathcal{L}}}}}_{{{{\rm{replay}}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq68.gif"/></alternatives></inline-formula>) did not increase. To achieve this, in every iteration, the gradient vector that was used to update the parameters (that is, the gradient vector that was put into the ADAM-optimizer) was required to have a positive angle with the gradient of <inline-formula id="IEq69"><alternatives><mml:math><mml:msub><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">replay</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="IEq69_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\mathcal{L}}}}}_{{{{\rm{replay}}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq69.gif"/></alternatives></inline-formula>. Therefore, whenever the angle between the gradient of <inline-formula id="IEq70"><alternatives><mml:math><mml:msub><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">current</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="IEq70_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\mathcal{L}}}}}_{{{{\rm{current}}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq70.gif"/></alternatives></inline-formula> and the gradient of <inline-formula id="IEq71"><alternatives><mml:math><mml:msub><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">replay</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="IEq71_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\mathcal{L}}}}}_{{{{\rm{replay}}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq71.gif"/></alternatives></inline-formula> was negative, the gradient of <inline-formula id="IEq72"><alternatives><mml:math><mml:msub><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">current</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="IEq72_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\mathcal{L}}}}}_{{{{\rm{current}}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq72.gif"/></alternatives></inline-formula> was projected onto the orthogonal complement of the gradient of <inline-formula id="IEq73"><alternatives><mml:math><mml:msub><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">replay</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="IEq73_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\mathcal{L}}}}}_{{{{\rm{replay}}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq73.gif"/></alternatives></inline-formula>. Let <inline-formula id="IEq74"><alternatives><mml:math><mml:msub><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">B</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">current</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="IEq74_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\mathcal{B}}}}}_{{{{\rm{current}}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq74.gif"/></alternatives></inline-formula> be the mini-batch of data from the current context and <inline-formula id="IEq75"><alternatives><mml:math><mml:msub><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">B</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">replay</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="IEq75_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\mathcal{B}}}}}_{{{{\rm{replay}}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq75.gif"/></alternatives></inline-formula> the mini-batch of replayed data from the memory buffer. The gradient of <inline-formula id="IEq76"><alternatives><mml:math><mml:msub><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">current</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="IEq76_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\mathcal{L}}}}}_{{{{\rm{current}}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq76.gif"/></alternatives></inline-formula> was then:<disp-formula id="Equ17"><label>17</label><alternatives><mml:math><mml:mrow><mml:msub><mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mi>g</mml:mi></mml:mrow></mml:mrow></mml:mrow></mml:mrow></mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mi mathvariant="normal">c</mml:mi><mml:mi mathvariant="normal">u</mml:mi><mml:mi mathvariant="normal">r</mml:mi><mml:mi mathvariant="normal">r</mml:mi><mml:mi mathvariant="normal">e</mml:mi><mml:mi mathvariant="normal">n</mml:mi><mml:mi mathvariant="normal">t</mml:mi></mml:mrow></mml:mrow></mml:mrow></mml:mrow></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mfrac><mml:mn>1</mml:mn><mml:mrow><mml:mrow><mml:mo>|</mml:mo></mml:mrow><mml:msub><mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mi mathvariant="script">B</mml:mi></mml:mrow></mml:mrow></mml:mrow></mml:mrow></mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mi mathvariant="normal">c</mml:mi><mml:mi mathvariant="normal">u</mml:mi><mml:mi mathvariant="normal">r</mml:mi><mml:mi mathvariant="normal">r</mml:mi><mml:mi mathvariant="normal">e</mml:mi><mml:mi mathvariant="normal">n</mml:mi><mml:mi mathvariant="normal">t</mml:mi></mml:mrow></mml:mrow></mml:mrow></mml:mrow></mml:mrow></mml:msub><mml:mrow><mml:mo>|</mml:mo></mml:mrow></mml:mrow></mml:mfrac><mml:munder><mml:mrow class="MJX-TeXAtom-OP MJX-fixedlimits"><mml:mo movablelimits="false">∑</mml:mo></mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mi>x</mml:mi></mml:mrow></mml:mrow></mml:mrow></mml:mrow><mml:mo>,</mml:mo><mml:mi>o</mml:mi><mml:mo>)</mml:mo><mml:mo>∈</mml:mo><mml:msub><mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mi mathvariant="script">B</mml:mi></mml:mrow></mml:mrow></mml:mrow></mml:mrow></mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mi mathvariant="normal">c</mml:mi><mml:mi mathvariant="normal">u</mml:mi><mml:mi mathvariant="normal">r</mml:mi><mml:mi mathvariant="normal">r</mml:mi><mml:mi mathvariant="normal">e</mml:mi><mml:mi mathvariant="normal">n</mml:mi><mml:mi mathvariant="normal">t</mml:mi></mml:mrow></mml:mrow></mml:mrow></mml:mrow></mml:mrow></mml:msub></mml:mrow></mml:munder><mml:mspace width="thickmathspace"/><mml:mfrac><mml:mrow><mml:mi>δ</mml:mi><mml:msup><mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mi mathvariant="script">L</mml:mi></mml:mrow></mml:mrow></mml:mrow></mml:mrow></mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mi mathvariant="normal">C</mml:mi></mml:mrow></mml:mrow></mml:mrow></mml:mrow></mml:mrow></mml:msup><mml:mo>(</mml:mo><mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mi>x</mml:mi></mml:mrow></mml:mrow></mml:mrow></mml:mrow><mml:mo>,</mml:mo><mml:mi>o</mml:mi><mml:mo>;</mml:mo><mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mi>θ</mml:mi></mml:mrow></mml:mrow></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:mi>δ</mml:mi><mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mi>θ</mml:mi></mml:mrow></mml:mrow></mml:mrow></mml:mrow></mml:mrow></mml:mfrac></mml:mrow></mml:math><tex-math id="Equ17_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{{g}}}}}_{{{{\rm{current}}}}}=\frac{1}{| {{{{\mathcal{B}}}}}_{{{{\rm{current}}}}}| }\mathop{\sum}\limits_{({{{{x}}}},o)\in {{{{\mathcal{B}}}}}_{{{{\rm{current}}}}}}\;\frac{\delta {{{{\mathcal{L}}}}}^{{{{\rm{C}}}}}({{{{x}}}},o;{{{{\theta }}}})}{\delta {{{{\theta }}}}}$$\end{document}</tex-math><graphic position="anchor" xlink:href="42256_2022_568_Article_Equ17.gif"/></alternatives></disp-formula>and the gradient of <inline-formula id="IEq77"><alternatives><mml:math><mml:msub><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">replay</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="IEq77_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\mathcal{L}}}}}_{{{{\rm{replay}}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq77.gif"/></alternatives></inline-formula> was given by:<disp-formula id="Equ18"><label>18</label><alternatives><mml:math><mml:mrow><mml:msub><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">replay</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mo>∣</mml:mo><mml:msub><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">B</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">replay</mml:mi></mml:mrow></mml:msub><mml:mo>∣</mml:mo></mml:mrow></mml:mfrac><mml:munder><mml:mrow><mml:mo>∑</mml:mo></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mi>o</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mo>∈</mml:mo><mml:msub><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">B</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">replay</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:munder><mml:mspace width="0.16em"/><mml:mfrac><mml:mrow><mml:mi>δ</mml:mi><mml:msup><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">C</mml:mi></mml:mrow></mml:msup><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mi>o</mml:mi><mml:mo>;</mml:mo><mml:mi>θ</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow><mml:mrow><mml:mi>δ</mml:mi><mml:mi>θ</mml:mi></mml:mrow></mml:mfrac></mml:mrow></mml:math><tex-math id="Equ18_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{{g}}}}}_{{{{\rm{replay}}}}}=\frac{1}{| {{{{\mathcal{B}}}}}_{{{{\rm{replay}}}}}| }\mathop{\sum}\limits_{({{{{x}}}},o)\in {{{{\mathcal{B}}}}}_{{{{\rm{replay}}}}}}\;\frac{\delta {{{{\mathcal{L}}}}}^{{{{\rm{C}}}}}({{{{x}}}},o;{{{{\theta }}}})}{\delta {{{{\theta }}}}}$$\end{document}</tex-math><graphic position="anchor" xlink:href="42256_2022_568_Article_Equ18.gif"/></alternatives></disp-formula>The gradient <italic>g</italic><sup>*</sup> used to update the parameters was then given by:<disp-formula id="Equ19"><label>19</label><alternatives><mml:math><mml:mrow><mml:msup><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mo>*</mml:mo></mml:mrow></mml:msup><mml:mo>=</mml:mo><mml:mfenced open="{"><mml:mrow><mml:mtable><mml:mtr><mml:mtd columnalign="left"><mml:msub><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">current</mml:mi></mml:mrow></mml:msub><mml:mspace width="1.0em"/></mml:mtd><mml:mtd columnalign="left"><mml:mi mathvariant="normal">if</mml:mi><mml:mspace width="0.25em"/><mml:msup><mml:mrow><mml:msub><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">current</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mi>T</mml:mi></mml:mrow></mml:msup><mml:msub><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">replay</mml:mi></mml:mrow></mml:msub><mml:mo>≥</mml:mo><mml:mn>0</mml:mn></mml:mtd></mml:mtr><mml:mtr><mml:mtd columnalign="left"><mml:msub><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">current</mml:mi></mml:mrow></mml:msub><mml:mo>−</mml:mo><mml:mfrac><mml:mrow><mml:msup><mml:mrow><mml:msub><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">current</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mi>T</mml:mi></mml:mrow></mml:msup><mml:msub><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">replay</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mfenced close=")" open="("><mml:mrow><mml:msup><mml:mrow><mml:msub><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">replay</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mi>T</mml:mi></mml:mrow></mml:msup><mml:msub><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">replay</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:mi>γ</mml:mi></mml:mrow></mml:mfenced></mml:mrow></mml:mfrac><mml:msub><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">replay</mml:mi></mml:mrow></mml:msub><mml:mspace width="1.0em"/></mml:mtd><mml:mtd columnalign="left"><mml:mi mathvariant="normal">otherwise</mml:mi><mml:mo>,</mml:mo></mml:mtd></mml:mtr></mml:mtable></mml:mrow></mml:mfenced></mml:mrow></mml:math><tex-math id="Equ19_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{{g}}}}}^{* }=\left\{\begin{array}{ll}{{{{{g}}}}}_{{{{\rm{current}}}}}\quad &amp;{{{\rm{if}}}}\,{{{{{{g}}}}}_{{{{\rm{current}}}}}}^{T}{{{{{g}}}}}_{{{{\rm{replay}}}}}\ge 0\\ {{{{{g}}}}}_{{{{\rm{current}}}}}-\frac{{{{{{{g}}}}}_{{{{\rm{current}}}}}}^{T}{{{{{g}}}}}_{{{{\rm{replay}}}}}}{\left({{{{{{g}}}}}_{{{{\rm{replay}}}}}}^{T}{{{{{g}}}}}_{{{{\rm{replay}}}}}+\gamma \right)}{{{{{g}}}}}_{{{{\rm{replay}}}}}\quad &amp;{{{\rm{otherwise}}}},\end{array}\right.$$\end{document}</tex-math><graphic position="anchor" xlink:href="42256_2022_568_Article_Equ19.gif"/></alternatives></disp-formula>with <italic>γ</italic> a small constant to ensure numerical stability. In A-GEM’s original formulation<sup><xref ref-type="bibr" rid="CR54">54</xref></sup> there was no <italic>γ</italic>-term, but we found that without it, performance was unstable. We used <italic>γ</italic> = 1 × 10<sup>−7</sup>.</p></sec><sec id="Sec31"><title>DGR</title><p id="Par70">With DGR<sup><xref ref-type="bibr" rid="CR27">27</xref></sup>, two neural networks were sequentially trained on all contexts: a classifier, for which we used the base neural network, and a separate generative model.</p><p id="Par71">For training of the classifier, as with ER and A-GEM, <inline-formula id="IEq78"><alternatives><mml:math><mml:msub><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">current</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="IEq78_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\mathcal{L}}}}}_{{{{\rm{current}}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq78.gif"/></alternatives></inline-formula> and <inline-formula id="IEq79"><alternatives><mml:math><mml:msub><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">replay</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="IEq79_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\mathcal{L}}}}}_{{{{\rm{replay}}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq79.gif"/></alternatives></inline-formula> were the standard classification loss on the data of the current context and the replayed data, respectively. With DGR, the replayed data was obtained by sampling inputs from a copy of the generative model and labelling them as the most likely class predicted for those inputs by a copy of the classifier. The samples replayed during context <italic>K</italic> were generated by copies of the generator and classifier stored directly after finishing training on context <italic>K</italic> − 1. With task-incremental learning, each replayed sample was labelled and evaluated separately for all previous contexts and <inline-formula id="IEq80"><alternatives><mml:math><mml:msub><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">replay</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="IEq80_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\mathcal{L}}}}}_{{{{\rm{replay}}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq80.gif"/></alternatives></inline-formula> was the average over those contexts.</p><p id="Par72">As generative model a variational autoencoder (VAE; ref. <sup><xref ref-type="bibr" rid="CR72">72</xref></sup>) was used, which consisted of an encoder network <italic>q</italic><sub><italic>ϕ</italic></sub> that mapped an input-vector <italic>x</italic> to a vector of latent variables <italic>z</italic>, and a decoder network <italic>p</italic><sub><italic>ψ</italic></sub> that mapped those latent variables back to a reconstructed or decoded input-vector <inline-formula id="IEq81"><alternatives><mml:math><mml:mover accent="true"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mo>̂</mml:mo></mml:mrow></mml:mover></mml:math><tex-math id="IEq81_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{\hat{{x}}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq81.gif"/></alternatives></inline-formula>. The architecture of these two networks was kept similar to that of the base neural network: for Split MNIST, the encoder and the decoder were both fully connected networks with two hidden layers of 400 ReLU each; for Split CIFAR-100, the encoder consisted of the same five pre-trained convolutional layers as the base neural network followed by two fully connected layers with 2,000 ReLU units, and the decoder consisted of two fully connected layers with 2,000 ReLU followed by five deconvolutional (or transposed convolutional) layers<sup><xref ref-type="bibr" rid="CR73">73</xref></sup> that mirrored the convolutional layers and contained 128, 64, 32, 16 and 3 channels. The first four deconvolutional layers used a 4×4 kernel, a padding of 1 and a stride of 2 (that is, image size was doubled in each of those layers), while the final layer used a 3×3 kernel, a padding of 1 and a stride of 1 (that is, no upsampling). Batch-norm and ReLU non-linearities were used in all deconvolutional layers except for the last one. For both context sets, the VAE’s latent variable layer <italic>z</italic> had 100 Gaussian units. The prior over the latent variables was the standard normal distribution.</p><p id="Par73">For a given input <italic>x</italic>, the loss function for training the parameters of the VAE was:<disp-formula id="Equ20"><label>20</label><alternatives><mml:math><mml:mrow><mml:msup><mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mi mathvariant="script">L</mml:mi></mml:mrow></mml:mrow></mml:mrow></mml:mrow></mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mi mathvariant="normal">G</mml:mi></mml:mrow></mml:mrow></mml:mrow></mml:mrow></mml:mrow></mml:msup><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mi>x</mml:mi></mml:mrow></mml:mrow></mml:mrow></mml:mrow><mml:mo>;</mml:mo><mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mi>ϕ</mml:mi></mml:mrow></mml:mrow></mml:mrow></mml:mrow><mml:mo>,</mml:mo><mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mi>ψ</mml:mi></mml:mrow></mml:mrow></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:msup><mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mi mathvariant="script">L</mml:mi></mml:mrow></mml:mrow></mml:mrow></mml:mrow></mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mi mathvariant="normal">l</mml:mi><mml:mi mathvariant="normal">a</mml:mi><mml:mi mathvariant="normal">t</mml:mi><mml:mi mathvariant="normal">e</mml:mi><mml:mi mathvariant="normal">n</mml:mi><mml:mi mathvariant="normal">t</mml:mi></mml:mrow></mml:mrow></mml:mrow></mml:mrow></mml:mrow></mml:msup><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mi>x</mml:mi></mml:mrow></mml:mrow></mml:mrow></mml:mrow><mml:mo>;</mml:mo><mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mi>ϕ</mml:mi></mml:mrow></mml:mrow></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mo>+</mml:mo><mml:msup><mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mi mathvariant="script">L</mml:mi></mml:mrow></mml:mrow></mml:mrow></mml:mrow></mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mi mathvariant="normal">r</mml:mi><mml:mi mathvariant="normal">e</mml:mi><mml:mi mathvariant="normal">c</mml:mi><mml:mi mathvariant="normal">o</mml:mi><mml:mi mathvariant="normal">n</mml:mi></mml:mrow></mml:mrow></mml:mrow></mml:mrow></mml:mrow></mml:msup><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mi>x</mml:mi></mml:mrow></mml:mrow></mml:mrow></mml:mrow><mml:mo>;</mml:mo><mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mi>ϕ</mml:mi></mml:mrow></mml:mrow></mml:mrow></mml:mrow><mml:mo>,</mml:mo><mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mi>ψ</mml:mi></mml:mrow></mml:mrow></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:math><tex-math id="Equ20_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\mathcal{L}}}}}^{{{{\rm{G}}}}}\left({{{{x}}}};{{{{\phi }}}},{{{{\psi }}}}\right)={{{{\mathcal{L}}}}}^{{{{\rm{latent}}}}}\left({{{{x}}}};{{{{\phi }}}}\right)+{{{{\mathcal{L}}}}}^{{{{\rm{recon}}}}}\left({{{{x}}}};{{{{\phi }}}},{{{{\psi }}}}\right)$$\end{document}</tex-math><graphic position="anchor" xlink:href="42256_2022_568_Article_Equ20.gif"/></alternatives></disp-formula>The first term in equation (<xref rid="Equ20" ref-type="disp-formula">20</xref>), the ‘latent variable regularization term’, was given by:<disp-formula id="Equ21"><label>21</label><alternatives><mml:math><mml:mrow><mml:msup><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">latent</mml:mi></mml:mrow></mml:msup><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>x</mml:mi><mml:mo>;</mml:mo><mml:mi>ϕ</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:mfrac><mml:munderover accent="false" accentunder="false"><mml:mrow><mml:mo>∑</mml:mo></mml:mrow><mml:mrow><mml:mi>j</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>N</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">latent</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:munderover><mml:mfenced close=")" open="("><mml:mrow><mml:mn>1</mml:mn><mml:mo>+</mml:mo><mml:mi>log</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msup><mml:mrow><mml:msubsup><mml:mrow><mml:mi>σ</mml:mi></mml:mrow><mml:mrow><mml:mi>j</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msubsup></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msup></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mo>−</mml:mo><mml:msup><mml:mrow><mml:msubsup><mml:mrow><mml:mi>μ</mml:mi></mml:mrow><mml:mrow><mml:mi>j</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msubsup></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msup><mml:mo>−</mml:mo><mml:msup><mml:mrow><mml:msubsup><mml:mrow><mml:mi>σ</mml:mi></mml:mrow><mml:mrow><mml:mi>j</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msubsup></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:mfenced></mml:mrow></mml:math><tex-math id="Equ21_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\mathcal{L}}}}}^{{{{\rm{latent}}}}}({{{{x}}}};{{{{\phi }}}})=\frac{1}{2}\mathop{\sum }\limits_{j=1}^{{N}_{{{{\rm{latent}}}}}}\left(1+\log ({{\sigma }_{j}^{({{{{x}}}})}}^{2})-{{\mu }_{j}^{({{{{x}}}})}}^{2}-{{\sigma }_{j}^{({{{{x}}}})}}^{2}\right)$$\end{document}</tex-math><graphic position="anchor" xlink:href="42256_2022_568_Article_Equ21.gif"/></alternatives></disp-formula>with <italic>N</italic><sub>latent</sub> the number of latent variables, and <inline-formula id="IEq82"><alternatives><mml:math><mml:msubsup><mml:mrow><mml:mi>μ</mml:mi></mml:mrow><mml:mrow><mml:mi>j</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi mathvariant="bold-italic">x</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msubsup></mml:math><tex-math id="IEq82_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${\mu }_{j}^{({{{\boldsymbol{x}}}})}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq82.gif"/></alternatives></inline-formula> and <inline-formula id="IEq83"><alternatives><mml:math><mml:msubsup><mml:mrow><mml:mi>σ</mml:mi></mml:mrow><mml:mrow><mml:mi>j</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msubsup></mml:math><tex-math id="IEq83_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${\sigma }_{j}^{({{{{x}}}})}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq83.gif"/></alternatives></inline-formula> the <italic>j</italic><sup>th</sup> elements of <italic>μ</italic><sup>(<italic>x</italic>)</sup> and <italic>σ</italic><sup>(<italic>x</italic>)</sup>, which were the outputs of the encoder network <italic>q</italic><sub><italic>ϕ</italic></sub> for input <italic>x</italic>. The second term in equation (<xref rid="Equ20" ref-type="disp-formula">20</xref>), the ‘reconstruction term’, was given by the squared error between the original and decoded pixel values:<disp-formula id="Equ22"><label>22</label><alternatives><mml:math><mml:mrow><mml:msup><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">recon</mml:mi></mml:mrow></mml:msup><mml:mfenced close=")" open="("><mml:mrow><mml:mi>x</mml:mi><mml:mo>;</mml:mo><mml:mi>ϕ</mml:mi><mml:mo>,</mml:mo><mml:mi>ψ</mml:mi></mml:mrow></mml:mfenced><mml:mo>=</mml:mo><mml:munderover accent="false" accentunder="false"><mml:mrow><mml:mo>∑</mml:mo></mml:mrow><mml:mrow><mml:mi>p</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>N</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">pixels</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:munderover><mml:msup><mml:mrow><mml:mfenced close=")" open="("><mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>p</mml:mi></mml:mrow></mml:msub><mml:mo>−</mml:mo><mml:msub><mml:mrow><mml:mover accent="true"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mo>̃</mml:mo></mml:mrow></mml:mover></mml:mrow><mml:mrow><mml:mi>p</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math><tex-math id="Equ22_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\mathcal{L}}}}}^{{{{\rm{recon}}}}}\left({{{{x}}}};{{{{\phi }}}},{{{{\psi }}}}\right)=\mathop{\sum }\limits_{p=1}^{{N}_{{{{\rm{pixels}}}}}}{\left({x}_{p}-{\tilde{x}}_{p}\right)}^{2}$$\end{document}</tex-math><graphic position="anchor" xlink:href="42256_2022_568_Article_Equ22.gif"/></alternatives></disp-formula>whereby <italic>x</italic><sub><italic>p</italic></sub> was the value of the <italic>p</italic><sup>th</sup> pixel of the original input image <italic>x</italic> and <inline-formula id="IEq84"><alternatives><mml:math><mml:msub><mml:mrow><mml:mover accent="true"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mo>̃</mml:mo></mml:mrow></mml:mover></mml:mrow><mml:mrow><mml:mi>p</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="IEq84_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${\tilde{x}}_{p}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq84.gif"/></alternatives></inline-formula> was the value of the <italic>p</italic><sup>th</sup> pixel of the decoded image <inline-formula id="IEq85"><alternatives><mml:math><mml:mrow><mml:mover accent="true"><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mo>̃</mml:mo></mml:mrow></mml:mover><mml:mo>=</mml:mo><mml:msub><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>ψ</mml:mi></mml:mrow></mml:msub><mml:mfenced close=")" open="("><mml:mrow><mml:msup><mml:mrow><mml:mi>z</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msup></mml:mrow></mml:mfenced></mml:mrow></mml:math><tex-math id="IEq85_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$$\tilde{{{{{x}}}}}={p}_{{{{{\psi }}}}}\left({{{{{z}}}}}^{({{{{x}}}})}\right)$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq85.gif"/></alternatives></inline-formula>, with <italic>z</italic><sup>(<italic>x</italic>)</sup> = <italic>μ</italic><sup>(<italic>x</italic>)</sup> + <italic>σ</italic><sup>(<italic>x</italic>)</sup> × <italic>ϵ</italic> and <italic>ϵ</italic> sampled from <inline-formula id="IEq86"><alternatives><mml:math><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">N</mml:mi><mml:mfenced close=")" open="("><mml:mrow><mml:mn>0</mml:mn><mml:mo>,</mml:mo><mml:mi>I</mml:mi></mml:mrow></mml:mfenced></mml:mrow></mml:math><tex-math id="IEq86_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{\mathcal{N}}}}\left(0,{{{{I}}}}\right)$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq86.gif"/></alternatives></inline-formula>.</p><p id="Par74">Training of the generative model was also done with generative replay, which was provided by its own copy stored after finishing training on the previous context. The loss terms of the current and replayed data were weighted similarly to the classifier:<disp-formula id="Equ23"><label>23</label><alternatives><mml:math><mml:mrow><mml:msubsup><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">total</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">G</mml:mi></mml:mrow></mml:msubsup><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>N</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">contexts</mml:mi><mml:mspace width="0.25em"/><mml:mi mathvariant="normal">so</mml:mi><mml:mspace width="0.25em"/><mml:mi mathvariant="normal">far</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfrac><mml:msubsup><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">current</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">G</mml:mi></mml:mrow></mml:msubsup><mml:mo>+</mml:mo><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mn>1</mml:mn><mml:mo>−</mml:mo><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>N</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">contexts</mml:mi><mml:mspace width="0.25em"/><mml:mi mathvariant="normal">so</mml:mi><mml:mspace width="0.25em"/><mml:mi mathvariant="normal">far</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfrac></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:msubsup><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">replay</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">G</mml:mi></mml:mrow></mml:msubsup></mml:mrow></mml:math><tex-math id="Equ23_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\mathcal{L}}}}}_{{{{\rm{total}}}}}^{{{{\rm{G}}}}}=\frac{1}{{N}_{{{{\rm{contexts}}}}\,{{{\rm{so}}}}\,{{{\rm{far}}}}}}{{{{\mathcal{L}}}}}_{{{{\rm{current}}}}}^{{{{\rm{G}}}}}+(1-\frac{1}{{N}_{{{{\rm{contexts}}}}\,{{{\rm{so}}}}\,{{{\rm{far}}}}}}){{{{\mathcal{L}}}}}_{{{{\rm{replay}}}}}^{{{{\rm{G}}}}}$$\end{document}</tex-math><graphic position="anchor" xlink:href="42256_2022_568_Article_Equ23.gif"/></alternatives></disp-formula></p></sec><sec id="Sec32"><title>BI-R</title><p id="Par75">For the method BI-R, we followed the protocol as described in the original paper<sup><xref ref-type="bibr" rid="CR28">28</xref></sup>. For Split CIFAR-100, all five of the proposed modifications relative to DGR were used: distillation, replay-through-feedback, conditional replay, gating based on internal context and internal replay. For Split MNIST, internal replay was not used, but the other four components were used. We did not combine BI-R with SI. The hyperparameter <italic>X</italic>, which controlled the proportion of hidden units in the decoder that was gated per class, was set based on a grid search (Supplementary Note <xref ref-type="supplementary-material" rid="MOESM1">8</xref>).</p><p id="Par76">Compared with ref. <sup><xref ref-type="bibr" rid="CR28">28</xref></sup> there were two slight differences: (1) here we used a different set of pre-trained convolutional layers for each random seed, while ref. <sup><xref ref-type="bibr" rid="CR28">28</xref></sup> always used the same pre-trained convolutional layers; and (2) in the class-incremental learning scenario, here we used a softmax layer with the output units of all classes always set to active, while ref. <sup><xref ref-type="bibr" rid="CR28">28</xref></sup> used an ‘expanding head’ (that is, only the output units of classes seen so far were set to active).</p></sec></sec><sec id="Sec33"><title>Template-based classification methods</title><p id="Par77">Although for the context sets considered in this article, the template-based classification methods could, in theory, be used for all three continual learning scenarios, we considered them only for class-incremental learning. This was because, from an incremental-learning perspective, the specific benefit of template-based classification (that is, rephrasing a class-incremental learning problem as a task-incremental learning problem, see Supplementary Note <xref ref-type="supplementary-material" rid="MOESM1">4</xref>) is only relevant in that scenario.</p><sec id="Sec34"><title>Generative classifier</title><p id="Par78">For the generative classifier<sup><xref ref-type="bibr" rid="CR55">55</xref></sup>, a separate VAE model was trained for each class to be learned. Training of these models was done as described above for DGR, except that no replay was used and each VAE was only trained on the examples from its own class. Each class-specific VAE was trained for either 1,000 iterations (Split MNIST) or 500 iterations (Split CIFAR-100), which meant that the total number of training iterations was the same as for the other methods. The mini-batch size was also the same: 128 for Split MNIST and 256 for Split CIFAR-100.</p><p id="Par79">The architecture of the VAE models was chosen so that the total number of parameters of the generative classifier was similar to the number of parameters used by generative replay. For Split MNIST, the encoder and the decoder were both fully connected networks with two hidden layers of 85 ReLU units each and the latent variable layer had five units. For Split CIFAR-100, the pre-trained convolutional layers were used as a feature extractor, and the VAE models were trained on the extracted features rather than on the raw inputs (that is, the reconstruction loss was in the feature space instead of at the pixel level). The encoder and decoder both had one fully connected hidden layer with 85 ReLU and a latent variable layer with 20 units.</p><p id="Par80">Classification was performed based on Bayes’ rule: a test sample was classified as the class under whose generative model it was estimated to be the most likely. That is, the output class label <italic>o</italic><sup>*</sup> predicted for an input <italic>x</italic> was given by:<disp-formula id="Equ24"><label>24</label><alternatives><mml:math><mml:mrow><mml:msup><mml:mrow><mml:mi>o</mml:mi></mml:mrow><mml:mrow><mml:mo>*</mml:mo></mml:mrow></mml:msup><mml:mo>=</mml:mo><mml:munder><mml:mrow><mml:mi mathvariant="normal">arg</mml:mi><mml:mspace width="0.25em"/><mml:mi mathvariant="normal">max</mml:mi></mml:mrow><mml:mrow><mml:mi>o</mml:mi></mml:mrow></mml:munder><mml:mspace width="0.25em"/><mml:mi>p</mml:mi><mml:mfenced close=")" open="("><mml:mrow><mml:mi>x</mml:mi><mml:mo>∣</mml:mo><mml:mi>o</mml:mi></mml:mrow></mml:mfenced></mml:mrow></mml:math><tex-math id="Equ24_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$$o^* = \mathop{\rm{arg}\,{\rm{max}}}\limits_o\,p\left({{x}}|o\right)$$\end{document}</tex-math><graphic position="anchor" xlink:href="42256_2022_568_Article_Equ24.gif"/></alternatives></disp-formula>whereby <italic>p</italic>(<bold><italic>x</italic></bold>∣<italic>o</italic>) was the likelihood of input <italic>x</italic> under the generative model of class <italic>o</italic>. These likelihoods were estimated using importance sampling<sup><xref ref-type="bibr" rid="CR74">74</xref></sup>:<disp-formula id="Equ25"><label>25</label><alternatives><mml:math><mml:mrow><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>x</mml:mi><mml:mo>∣</mml:mo><mml:mi>o</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>S</mml:mi></mml:mrow></mml:mfrac><mml:munderover accent="false" accentunder="false"><mml:mrow><mml:mo>∑</mml:mo></mml:mrow><mml:mrow><mml:mi>s</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>S</mml:mi></mml:mrow></mml:munderover><mml:mfrac><mml:mrow><mml:mi>f</mml:mi><mml:mfenced close=")" open="("><mml:mrow><mml:mi>x</mml:mi><mml:mfenced open="∣"><mml:mrow><mml:mspace width="0.25em"/><mml:msubsup><mml:mrow><mml:mi>μ</mml:mi></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>ψ</mml:mi></mml:mrow><mml:mrow><mml:mi>o</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mfenced close=")" open="("><mml:mrow><mml:msup><mml:mrow><mml:mi>z</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>s</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msup></mml:mrow></mml:mfenced></mml:mrow></mml:msubsup><mml:mo>,</mml:mo><mml:mi>I</mml:mi></mml:mrow></mml:mfenced></mml:mrow></mml:mfenced><mml:mi>f</mml:mi><mml:mfenced close=")" open="("><mml:mrow><mml:mfenced close="∣"><mml:mrow><mml:msup><mml:mrow><mml:mi>z</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>s</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msup></mml:mrow></mml:mfenced><mml:mspace width="0.25em"/><mml:mn>0</mml:mn><mml:mo>,</mml:mo><mml:mi>I</mml:mi></mml:mrow></mml:mfenced></mml:mrow><mml:mrow><mml:mi>f</mml:mi><mml:mfenced close=")" open="("><mml:mrow><mml:msup><mml:mrow><mml:mi>z</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>s</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msup><mml:mfenced open="∣"><mml:mrow><mml:mspace width="0.25em"/><mml:msubsup><mml:mrow><mml:mi>μ</mml:mi></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>ϕ</mml:mi></mml:mrow><mml:mrow><mml:mi>o</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msubsup><mml:mo>,</mml:mo><mml:msup><mml:mrow><mml:msubsup><mml:mrow><mml:mi>σ</mml:mi></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>ϕ</mml:mi></mml:mrow><mml:mrow><mml:mi>o</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msubsup></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msup><mml:mi>I</mml:mi></mml:mrow></mml:mfenced></mml:mrow></mml:mfenced></mml:mrow></mml:mfrac></mml:mrow></mml:math><tex-math id="Equ25_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$$p({{{{x}}}}| o)=\frac{1}{S}\mathop{\sum }\limits_{s=1}^{S}\frac{f\left({{{{x}}}}\left|\,{{{{{\mu }}}}}_{{{{{{\psi }}}}}_{o}}^{\left({{{{{z}}}}}^{(s)}\right)},I\right.\right)f\left(\left.{{{{{z}}}}}^{(s)}\right|\,{{{{0}}}},I\right)}{f\left({{{{{z}}}}}^{(s)}\left|\,{{{{{\mu }}}}}_{{{{{{\phi }}}}}_{o}}^{({{{{x}}}})},{{{{{{\sigma }}}}}_{{{{{{\phi }}}}}_{o}}^{({{{{x}}}})}}^{2}I\right.\right)}$$\end{document}</tex-math><graphic position="anchor" xlink:href="42256_2022_568_Article_Equ25.gif"/></alternatives></disp-formula>with <inline-formula id="IEq87"><alternatives><mml:math><mml:msubsup><mml:mrow><mml:mi>μ</mml:mi></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>ϕ</mml:mi></mml:mrow><mml:mrow><mml:mi>o</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msubsup></mml:math><tex-math id="IEq87_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{{\mu }}}}}_{{{{{{\phi }}}}}_{o}}^{({{{{x}}}})}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq87.gif"/></alternatives></inline-formula> and <inline-formula id="IEq88"><alternatives><mml:math><mml:msubsup><mml:mrow><mml:mi>σ</mml:mi></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>ϕ</mml:mi></mml:mrow><mml:mrow><mml:mi>o</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msubsup></mml:math><tex-math id="IEq88_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{{\sigma }}}}}_{{{{{{\phi }}}}}_{o}}^{({{{{x}}}})}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq88.gif"/></alternatives></inline-formula> the outputs of the encoder network for input <italic>x</italic>, <inline-formula id="IEq89"><alternatives><mml:math><mml:msubsup><mml:mrow><mml:mi>μ</mml:mi></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>ψ</mml:mi></mml:mrow><mml:mrow><mml:mi>o</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mfenced close=")" open="("><mml:mrow><mml:mi>z</mml:mi></mml:mrow></mml:mfenced></mml:mrow></mml:msubsup></mml:math><tex-math id="IEq89_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{{\mu }}}}}_{{{{{{\psi }}}}}_{o}}^{\left({{{{z}}}}\right)}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq89.gif"/></alternatives></inline-formula> the output of the decoder network for input <italic>z</italic>, <italic>S</italic> the number of importance samples and <italic>z</italic><sup>(<italic>s</italic>)</sup> the <italic>s</italic><sup>th</sup> importance sample drawn from <inline-formula id="IEq90"><alternatives><mml:math><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">N</mml:mi><mml:mfenced close=")" open="("><mml:mrow><mml:msubsup><mml:mrow><mml:mi>μ</mml:mi></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>ϕ</mml:mi></mml:mrow><mml:mrow><mml:mi>o</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msubsup><mml:mo>,</mml:mo><mml:msup><mml:mrow><mml:msubsup><mml:mrow><mml:mi>σ</mml:mi></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>ϕ</mml:mi></mml:mrow><mml:mrow><mml:mi>o</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msubsup></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msup><mml:mi>I</mml:mi></mml:mrow></mml:mfenced></mml:mrow></mml:math><tex-math id="IEq90_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{\mathcal{N}}}}\left({{{{{\mu }}}}}_{{{{{{\phi }}}}}_{o}}^{({{{{x}}}})},{{{{{{\sigma }}}}}_{{{{{{\phi }}}}}_{o}}^{({{{{x}}}})}}^{2}I\right)$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq90.gif"/></alternatives></inline-formula>. In this notation, <inline-formula id="IEq91"><alternatives><mml:math><mml:mrow><mml:mi>f</mml:mi><mml:mfenced close=")" open="("><mml:mrow><mml:mi>x</mml:mi><mml:mfenced open="∣"><mml:mrow><mml:mspace width="0.25em"/><mml:mi>μ</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">Σ</mml:mi></mml:mrow></mml:mfenced></mml:mrow></mml:mfenced></mml:mrow></mml:math><tex-math id="IEq91_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$$f\left({{{{x}}}}\left|\,{{{{\mu }}}},{{\Sigma }}\right.\right)$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq91.gif"/></alternatives></inline-formula> indicates the probability density of <italic>x</italic> under the multivariate normal distribution with mean <italic>μ</italic> and covariance matrix Σ. Similar to ref. <sup><xref ref-type="bibr" rid="CR55">55</xref></sup>, we used <italic>S</italic> = 10,000 importance samples per likelihood estimation.</p></sec><sec id="Sec35"><title>iCaRL</title><p id="Par81">The method iCaRL (ref. <sup><xref ref-type="bibr" rid="CR25">25</xref></sup>) used a neural network for feature extraction and then performed classification based on a nearest-class-mean rule in that feature space, whereby the class means were calculated from stored data. To protect the feature extractor network from becoming unsuitable for previously learned contexts, iCaRL also replayed the stored data—as well as the inputs from the current context with a special form of distillation—during training of the feature extractor.</p><p id="Par82">For the feature extractor we used the base neural network, except with the softmax output layer removed. We denote this feature extractor by <italic>ψ</italic><sub><italic>ϕ</italic></sub>(.), with trainable parameters <italic>ϕ</italic>. These parameters were trained based on a binary classification/distillation loss. For this, during training only, a sigmoid output layer was appended to <italic>ψ</italic><sub><italic>ϕ</italic></sub>. The resulting extended network outputs for any output class <italic>o</italic> ∈ {1, …, <italic>N</italic><sub>classes so far</sub>} a binary probability whether input <italic>x</italic> belongs to it:<disp-formula id="Equ26"><label>26</label><alternatives><mml:math><mml:mrow><mml:msubsup><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>θ</mml:mi></mml:mrow><mml:mrow><mml:mi>o</mml:mi></mml:mrow></mml:msubsup><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mn>1</mml:mn><mml:mo>+</mml:mo><mml:msup><mml:mrow><mml:mi mathvariant="normal">e</mml:mi></mml:mrow><mml:mrow><mml:mo>−</mml:mo><mml:msubsup><mml:mrow><mml:mi>w</mml:mi></mml:mrow><mml:mrow><mml:mi>o</mml:mi></mml:mrow><mml:mrow><mml:mi>T</mml:mi></mml:mrow></mml:msubsup><mml:msub><mml:mrow><mml:mi>ψ</mml:mi></mml:mrow><mml:mrow><mml:mi>ϕ</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msup></mml:mrow></mml:mfrac></mml:mrow></mml:math><tex-math id="Equ26_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${p}_{{{{{\theta }}}}}^{o}({{{{x}}}})=\frac{1}{1+{\mathrm{e}}^{-{{{{{w}}}}}_{o}^{T}{\psi }_{{{{{\phi }}}}}({{{{x}}}})}}$$\end{document}</tex-math><graphic position="anchor" xlink:href="42256_2022_568_Article_Equ26.gif"/></alternatives></disp-formula>with <inline-formula id="IEq92"><alternatives><mml:math><mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mi>θ</mml:mi></mml:mrow></mml:mrow></mml:mrow></mml:mrow><mml:mo>=</mml:mo><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mi>ϕ</mml:mi></mml:mrow></mml:mrow></mml:mrow></mml:mrow><mml:mo>,</mml:mo><mml:msub><mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mi>w</mml:mi></mml:mrow></mml:mrow></mml:mrow></mml:mrow></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:mo>…</mml:mo><mml:mo>,</mml:mo><mml:msub><mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mi>w</mml:mi></mml:mrow></mml:mrow></mml:mrow></mml:mrow></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>N</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mrow><mml:mi mathvariant="normal">c</mml:mi><mml:mi mathvariant="normal">l</mml:mi><mml:mi mathvariant="normal">a</mml:mi><mml:mi mathvariant="normal">s</mml:mi><mml:mi mathvariant="normal">s</mml:mi><mml:mi mathvariant="normal">e</mml:mi><mml:mi mathvariant="normal">s</mml:mi></mml:mrow><mml:mspace width="thinmathspace"/><mml:mrow><mml:mi mathvariant="normal">s</mml:mi><mml:mi mathvariant="normal">o</mml:mi></mml:mrow><mml:mspace width="thinmathspace"/><mml:mrow><mml:mi mathvariant="normal">f</mml:mi><mml:mi mathvariant="normal">a</mml:mi><mml:mi mathvariant="normal">r</mml:mi></mml:mrow></mml:mrow></mml:mrow></mml:mrow></mml:mrow></mml:msub></mml:mrow></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:math><tex-math id="IEq92_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\theta }}}}=\left({{{{\phi }}}},{{{{{w}}}}}_{1},\ldots,{{{{{w}}}}}_{{N}_{{{{\rm{classes}\,{so}\,{far}}}}}}\right)$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq92.gif"/></alternatives></inline-formula> a vector containing all the trainable parameters of iCaRL. Whenever a new output class <italic>o</italic> was encountered, new parameters <italic>w</italic><sub><italic>o</italic></sub> were added to <italic>θ</italic>.</p><p id="Par83">In each context, the parameters in <italic>θ</italic> were trained on an extended dataset containing the current context’s training data as well as all stored data in the memory buffer. When training on context <italic>K</italic>, each input <italic>x</italic> with hard target <italic>o</italic> in this extended dataset was paired with a new target-vector <inline-formula id="IEq93"><alternatives><mml:math><mml:mover accent="true"><mml:mrow><mml:mi>o</mml:mi></mml:mrow><mml:mo>¯</mml:mo></mml:mover></mml:math><tex-math id="IEq93_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{\bar{{o}}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq93.gif"/></alternatives></inline-formula> whose <italic>j</italic><sup>th</sup> element was given by:<disp-formula id="Equ27"><label>27</label><alternatives><mml:math><mml:mrow><mml:msub><mml:mrow><mml:mi>ō</mml:mi></mml:mrow><mml:mrow><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mfenced open="{"><mml:mrow><mml:mtable><mml:mtr><mml:mtd columnalign="left"><mml:msubsup><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:msup><mml:mrow><mml:mover accent="true"><mml:mrow><mml:mi>θ</mml:mi></mml:mrow><mml:mrow><mml:mo>̂</mml:mo></mml:mrow></mml:mover></mml:mrow><mml:mrow><mml:mo>*</mml:mo></mml:mrow></mml:msup></mml:mrow><mml:mrow><mml:mi>j</mml:mi></mml:mrow></mml:msubsup><mml:mfenced close=")" open="("><mml:mrow><mml:mi>x</mml:mi></mml:mrow></mml:mfenced><mml:mspace width="1.0em"/></mml:mtd><mml:mtd columnalign="left"><mml:mi mathvariant="normal">if</mml:mi><mml:mspace width="0.25em"/><mml:mi mathvariant="normal">output</mml:mi><mml:mspace width="0.25em"/><mml:mi mathvariant="normal">class</mml:mi><mml:mspace width="0.25em"/><mml:mi>j</mml:mi><mml:mspace width="0.25em"/><mml:mi mathvariant="normal">in</mml:mi><mml:mspace width="0.25em"/><mml:mi mathvariant="normal">context</mml:mi><mml:mspace width="0.25em"/><mml:mn>1</mml:mn><mml:mo>,</mml:mo><mml:mo>…</mml:mo><mml:mo>,</mml:mo><mml:mi>K</mml:mi><mml:mo>−</mml:mo><mml:mn>1</mml:mn></mml:mtd></mml:mtr><mml:mtr><mml:mtd columnalign="left"><mml:msub><mml:mrow><mml:mi mathvariant="double-struck">1</mml:mi></mml:mrow><mml:mrow><mml:mfenced close="}" open="{"><mml:mrow><mml:mi>o</mml:mi><mml:mo>=</mml:mo><mml:mi>j</mml:mi></mml:mrow></mml:mfenced></mml:mrow></mml:msub><mml:mspace width="1.0em"/></mml:mtd><mml:mtd columnalign="left"><mml:mi mathvariant="normal">if</mml:mi><mml:mspace width="0.25em"/><mml:mi mathvariant="normal">output</mml:mi><mml:mspace width="0.25em"/><mml:mi mathvariant="normal">class</mml:mi><mml:mspace width="0.25em"/><mml:mi>j</mml:mi><mml:mspace width="0.25em"/><mml:mi mathvariant="normal">in</mml:mi><mml:mspace width="0.25em"/><mml:mi mathvariant="normal">context</mml:mi><mml:mspace width="0.25em"/><mml:mi>K</mml:mi></mml:mtd></mml:mtr></mml:mtable></mml:mrow></mml:mfenced></mml:mrow></mml:math><tex-math id="Equ27_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${\bar{o}}_{j}=\left\{\begin{array}{ll}{p}_{{\hat{{{{{\theta }}}}}}^{* }}^{j}\left({{{{x}}}}\right)\quad &amp;{{{\rm{if}}}}\,{{{\rm{output}}}}\,{{{\rm{class}}}}\,j\,{{{\rm{in}}}}\,{{{\rm{context}}}}\,1,\ldots,K-1\\ {{\mathbb{1}}}_{\left\{o = j\right\}}\quad &amp;{{{\rm{if}}}}\,{{{\rm{output}}}}\,{{{\rm{class}}}}\,j\,{{{\rm{in}}}}\,{{{\rm{context}}}}\,K\end{array}\right.$$\end{document}</tex-math><graphic position="anchor" xlink:href="42256_2022_568_Article_Equ27.gif"/></alternatives></disp-formula>whereby <inline-formula id="IEq94"><alternatives><mml:math><mml:msup><mml:mrow><mml:mover accent="true"><mml:mrow><mml:mi>θ</mml:mi></mml:mrow><mml:mrow><mml:mo>̂</mml:mo></mml:mrow></mml:mover></mml:mrow><mml:mrow><mml:mo>*</mml:mo></mml:mrow></mml:msup></mml:math><tex-math id="IEq94_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${\hat{{{{{\theta }}}}}}^{* }$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq94.gif"/></alternatives></inline-formula> is the vector with parameter values at the end of training on context <italic>K</italic> − 1. The binary classification/distillation loss function for an input <italic>x</italic> labelled with such an ‘old-context-soft-target/new-context-hard-target’ vector <inline-formula id="IEq95"><alternatives><mml:math><mml:mover accent="true"><mml:mrow><mml:mi>o</mml:mi></mml:mrow><mml:mo>¯</mml:mo></mml:mover></mml:math><tex-math id="IEq95_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{\bar{{o}}}}}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq95.gif"/></alternatives></inline-formula> was then given by:<disp-formula id="Equ28"><label>28</label><alternatives><mml:math><mml:mrow><mml:msub><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">L</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">iCaRL</mml:mi></mml:mrow></mml:msub><mml:mfenced close=")" open="("><mml:mrow><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mover accent="true"><mml:mrow><mml:mi>o</mml:mi></mml:mrow><mml:mo>¯</mml:mo></mml:mover><mml:mo>;</mml:mo><mml:mi>θ</mml:mi></mml:mrow></mml:mfenced><mml:mo>=</mml:mo><mml:mo>−</mml:mo><mml:munderover accent="false" accentunder="false"><mml:mrow><mml:mo>∑</mml:mo></mml:mrow><mml:mrow><mml:mi>j</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>N</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">classes</mml:mi><mml:mspace width="0.25em"/><mml:mi mathvariant="normal">so</mml:mi><mml:mspace width="0.25em"/><mml:mi mathvariant="normal">far</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:munderover><mml:mfenced close="]" open="["><mml:mrow><mml:msub><mml:mrow><mml:mi>ō</mml:mi></mml:mrow><mml:mrow><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mi>log</mml:mi><mml:msubsup><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>θ</mml:mi></mml:mrow><mml:mrow><mml:mi>j</mml:mi></mml:mrow></mml:msubsup><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mo>+</mml:mo><mml:mfenced close=")" open="("><mml:mrow><mml:mn>1</mml:mn><mml:mo>−</mml:mo><mml:msub><mml:mrow><mml:mi>ō</mml:mi></mml:mrow><mml:mrow><mml:mi>j</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced><mml:mi>log</mml:mi><mml:mfenced close=")" open="("><mml:mrow><mml:mn>1</mml:mn><mml:mo>−</mml:mo><mml:msubsup><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>θ</mml:mi></mml:mrow><mml:mrow><mml:mi>j</mml:mi></mml:mrow></mml:msubsup><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:mfenced></mml:mrow></mml:mfenced></mml:mrow></mml:math><tex-math id="Equ28_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\mathcal{L}}}}}_{{{{\rm{iCaRL}}}}}\left({{{{x}}}},{{{\bar{{o}}}}};{{{{\theta }}}}\right)=-\mathop{\sum }\limits_{j=1}^{{N}_{{{{\rm{classes}}}}\,{{{\rm{so}}}}\,{{{\rm{far}}}}}}\left[{\bar{o}}_{j}\log {p}_{{{{{\theta }}}}}^{j}({{{{x}}}})+\left(1-{\bar{o}}_{j}\right)\log \left(1-{p}_{{{{{\theta }}}}}^{j}({{{{x}}}})\right)\right]$$\end{document}</tex-math><graphic position="anchor" xlink:href="42256_2022_568_Article_Equ28.gif"/></alternatives></disp-formula></p><p id="Par84">After finishing training on a context, data to be added to the memory buffer were selected as follows. For each new output class <italic>o</italic>, iteratively <italic>B</italic> samples (or ‘exemplars’) were selected based on their extracted feature vectors according to a procedure referred to as ‘herding’. In each iteration, a new sample from output class <italic>o</italic> was selected such that the average feature vector over all selected examples was as close as possible to the average feature vector over all available examples of class <italic>o</italic>. Let <inline-formula id="IEq96"><alternatives><mml:math><mml:mrow><mml:msup><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">X</mml:mi></mml:mrow><mml:mrow><mml:mi>o</mml:mi></mml:mrow></mml:msup><mml:mo>=</mml:mo><mml:mrow><mml:mo>{</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:mo>.</mml:mo><mml:mo>.</mml:mo><mml:mo>.</mml:mo><mml:mo>,</mml:mo><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>N</mml:mi></mml:mrow><mml:mrow><mml:mi>o</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:msub></mml:mrow><mml:mo>}</mml:mo></mml:mrow></mml:mrow></mml:math><tex-math id="IEq96_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\mathcal{X}}}}}^{o}=\{{{{{{x}}}}}_{1},...,{{{{{x}}}}}_{{N}_{o}}\}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq96.gif"/></alternatives></inline-formula> be the set of all available examples of class <italic>o</italic> and let <inline-formula id="IEq97"><alternatives><mml:math><mml:mrow><mml:msup><mml:mrow><mml:mi>μ</mml:mi></mml:mrow><mml:mrow><mml:mi>o</mml:mi></mml:mrow></mml:msup><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>N</mml:mi></mml:mrow><mml:mrow><mml:mi>o</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfrac><mml:msub><mml:mrow><mml:mo mathsize="big">∑</mml:mo></mml:mrow><mml:mrow><mml:mi>x</mml:mi><mml:mo>∈</mml:mo><mml:msup><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">X</mml:mi></mml:mrow><mml:mrow><mml:mi>o</mml:mi></mml:mrow></mml:msup></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>ψ</mml:mi></mml:mrow><mml:mrow><mml:mi>ϕ</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:math><tex-math id="IEq97_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{{\mu }}}}}^{o}=\frac{1}{{N}_{o}}{\sum }_{{{{{x}}}}\in {{{{\mathcal{X}}}}}^{o}}{\psi }_{{{{{\phi }}}}}({{{{x}}}})$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq97.gif"/></alternatives></inline-formula> be the average feature vector over set <inline-formula id="IEq98"><alternatives><mml:math><mml:msup><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">X</mml:mi></mml:mrow><mml:mrow><mml:mi>o</mml:mi></mml:mrow></mml:msup></mml:math><tex-math id="IEq98_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\mathcal{X}}}}}^{o}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq98.gif"/></alternatives></inline-formula>. The <italic>n</italic><sup>th</sup> exemplar (for <italic>n</italic> = 1, …, <italic>m</italic>) to be selected for output class <italic>o</italic> was then given by:<disp-formula id="Equ29"><label>29</label><alternatives><mml:math><mml:mrow><mml:msubsup><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mi>o</mml:mi></mml:mrow></mml:msubsup><mml:mo>=</mml:mo><mml:munder><mml:mrow><mml:mi mathvariant="normal">arg</mml:mi><mml:mspace width="0.25em"/><mml:mi mathvariant="normal">min</mml:mi></mml:mrow><mml:mrow><mml:mi>x</mml:mi><mml:mspace width="0.25em"/><mml:mo>∈</mml:mo><mml:msup><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">X</mml:mi></mml:mrow><mml:mrow><mml:mi>o</mml:mi></mml:mrow></mml:msup></mml:mrow></mml:munder><mml:mfenced close="∥" open="∥"><mml:mrow><mml:msup><mml:mrow><mml:mi>μ</mml:mi></mml:mrow><mml:mrow><mml:mi>o</mml:mi></mml:mrow></mml:msup><mml:mo>−</mml:mo><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>n</mml:mi></mml:mrow></mml:mfrac><mml:mfenced close=")" open="("><mml:mrow><mml:msub><mml:mrow><mml:mi>ψ</mml:mi></mml:mrow><mml:mrow><mml:mi>ϕ</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mo>+</mml:mo><mml:munderover accent="false" accentunder="false"><mml:mrow><mml:mo mathsize="big"> ∑</mml:mo></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>n</mml:mi><mml:mo>−</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:munderover><mml:msub><mml:mrow><mml:mi>ψ</mml:mi></mml:mrow><mml:mrow><mml:mi>ϕ</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msubsup><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow><mml:mrow><mml:mi>o</mml:mi></mml:mrow></mml:msubsup></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:mfenced></mml:mrow></mml:mfenced></mml:mrow></mml:math><tex-math id="Equ29_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{p}}_{n}^{o} = \mathop{\rm{arg}\,{\rm{min}}}\limits_{{{x}}\,\in {\mathcal{X}}^o} \left\|{{\mu}}^o-\frac{1}{n}\left(\psi_{{{\phi}}}({{x}})+\sum\limits_{i=1}^{n-1}\psi_{{{\phi}}}({{p}}_{i}^{o})\right)\right\|$$\end{document}</tex-math><graphic position="anchor" xlink:href="42256_2022_568_Article_Equ29.gif"/></alternatives></disp-formula>This resulted in ordered exemplar-sets <inline-formula id="IEq99"><alternatives><mml:math><mml:mrow><mml:msup><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">P</mml:mi></mml:mrow><mml:mrow><mml:mi>o</mml:mi></mml:mrow></mml:msup><mml:mo>=</mml:mo><mml:mrow><mml:mo>{</mml:mo><mml:mrow><mml:msubsup><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>o</mml:mi></mml:mrow></mml:msubsup><mml:mo>,</mml:mo><mml:mo>…</mml:mo><mml:mo>,</mml:mo><mml:msubsup><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>o</mml:mi></mml:mrow></mml:msubsup></mml:mrow><mml:mo>}</mml:mo></mml:mrow></mml:mrow></mml:math><tex-math id="IEq99_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{\mathcal{P}}}}}^{o}=\{{{{{{p}}}}}_{1}^{o},\ldots,{{{{{p}}}}}_{m}^{o}\}$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq99.gif"/></alternatives></inline-formula> for each new output class <italic>o</italic> that were stored in the memory buffer.</p><p id="Par85">Finally, classification was performed based on a nearest-class-mean rule in feature space, whereby the class means were calculated from the stored exemplars. For this, let <inline-formula id="IEq100"><alternatives><mml:math><mml:mrow><mml:msub><mml:mrow><mml:mi>μ</mml:mi></mml:mrow><mml:mrow><mml:mi>o</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mfenced close="∣" open="∣"><mml:mrow><mml:msup><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">P</mml:mi></mml:mrow><mml:mrow><mml:mi>o</mml:mi></mml:mrow></mml:msup></mml:mrow></mml:mfenced></mml:mrow></mml:mfrac><mml:msub><mml:mrow><mml:mo mathsize="big">∑</mml:mo></mml:mrow><mml:mrow><mml:mi>p</mml:mi><mml:mo>∈</mml:mo><mml:msup><mml:mrow><mml:mi class="MJX-tex-caligraphic" mathvariant="script">P</mml:mi></mml:mrow><mml:mrow><mml:mi>o</mml:mi></mml:mrow></mml:msup></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>ψ</mml:mi></mml:mrow><mml:mrow><mml:mi>ϕ</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:math><tex-math id="IEq100_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$${{{{{\mu }}}}}_{o}=\frac{1}{\left|{{{{\mathcal{P}}}}}^{o}\right|}{\sum }_{{{{{p}}}}\in {{{{\mathcal{P}}}}}^{o}}{\psi }_{{{{{\phi }}}}}({{{{p}}}})$$\end{document}</tex-math><inline-graphic xlink:href="42256_2022_568_Article_IEq100.gif"/></alternatives></inline-formula> for <italic>o</italic> = 1, …, <italic>N</italic><sub>classes so far</sub>. The output class label <italic>o</italic><sup>*</sup> predicted for a new input <italic>x</italic> was then given by:<disp-formula id="Equ30"><label>30</label><alternatives><mml:math><mml:mrow><mml:msup><mml:mrow><mml:mi>o</mml:mi></mml:mrow><mml:mrow><mml:mo>*</mml:mo></mml:mrow></mml:msup><mml:mo>=</mml:mo><mml:munder><mml:mrow><mml:mi mathvariant="normal">arg</mml:mi><mml:mi mathvariant="normal">min</mml:mi></mml:mrow><mml:mrow><mml:mi>o</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mo>,</mml:mo><mml:mo>…</mml:mo><mml:mo>,</mml:mo><mml:msub><mml:mrow><mml:mi>N</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">classes</mml:mi><mml:mspace width="0.25em"/><mml:mi mathvariant="normal">so</mml:mi><mml:mspace width="0.25em"/><mml:mi mathvariant="normal">far</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:munder><mml:mspace width="0.25em"/><mml:mfenced close="∥" open="∥"><mml:mrow><mml:msub><mml:mrow><mml:mi>ψ</mml:mi></mml:mrow><mml:mrow><mml:mi>ϕ</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mo>−</mml:mo><mml:msub><mml:mrow><mml:mi>μ</mml:mi></mml:mrow><mml:mrow><mml:mi>o</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:mrow></mml:math><tex-math id="Equ30_TeX">\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym}
				\usepackage{amsfonts}
				\usepackage{amssymb}
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$$o^* = \mathop{\rm{arg}{\rm{min}}}\limits_{o=1,\ldots,N_{{\rm{classes}}\,{\rm{so}}\,{\rm{far}}}}\,\left\|\psi_{{{\phi}}}({{x}})-{{\mu}}_o\right\|$$\end{document}</tex-math><graphic position="anchor" xlink:href="42256_2022_568_Article_Equ30.gif"/></alternatives></disp-formula></p></sec></sec></sec></body><back><ack><title>Acknowledgements</title><p>We thank K. Jensen, M. Mundt, W. Barfuss, T. Hess and M. De Lange for insightful comments. This research project was supported by an IBRO-ISN Research Fellowship (to G.M.v.d.V.), by the ERC-funded project KeepOnLearning (reference number 101021347; to T.T.), by the National Institutes of Health (NIH) under awards R01MH109556 (NIH/NIMH; to A.S.T.) and P30EY002520 (NIH/NEI; to A.S.T.), by the Lifelong Learning Machines (L2M) programme of the Defence Advanced Research Projects Agency (DARPA) via contract number HR0011-18-2-0025 (to A.S.T.) and by the Intelligence Advanced Research Projects Activity (IARPA) via Department of Interior/Interior Business Center (DoI/IBC) contract number D16PC00003 (to A.S.T.). The 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 NIH, DARPA, IARPA, DoI/IBC or the US government.</p></ack><sec sec-type="author-contribution"><title>Author contributions</title><p>Conceptualization, G.M.v.d.V, T.T. and A.S.T.; formal analysis, G.M.v.d.V.; funding acquisition, A.S.T., T.T. and G.M.v.d.V.; investigation, G.M.v.d.V.; methodology, G.M.v.d.V.; resources, A.S.T.; software, G.M.v.d.V.; supervision, A.S.T. and T.T.; visualization, G.M.v.d.V.; writing – original draft, G.M.v.d.V.; writing – review and editing, G.M.v.d.V., T.T. and A.S.T.</p></sec><sec sec-type="peer-review"><title>Peer review</title><sec id="FPar3"><title>Peer review information</title><p id="Par88"><italic>Nature Machine Intelligence</italic> thanks Thomas Miconi and the other, anonymous, reviewer(s) for their contribution to the peer review of this work.</p></sec></sec><sec sec-type="data-availability"><title>Data availability</title><p>All datasets used in this study are freely available online resources: <ext-link xlink:href="http://yann.lecun.com/exdb/mnist/" ext-link-type="url">http://yann.lecun.com/exdb/mnist/</ext-link> (MNIST<sup><xref ref-type="bibr" rid="CR66">66</xref></sup>) and <ext-link xlink:href="https://www.cs.toronto.edu/~kriz/cifar.html" ext-link-type="url">https://www.cs.toronto.edu/~kriz/cifar.html</ext-link> (CIFAR-10 and CIFAR-100<sup><xref ref-type="bibr" rid="CR67">67</xref></sup>).</p></sec><sec sec-type="data-availability"><title>Code availability</title><p>Documented code that can be used to reproduce or build upon the reported experiments is available online under an MIT licence: <ext-link xlink:href="https://github.com/GMvandeVen/continual-learning" ext-link-type="url">https://github.com/GMvandeVen/continual-learning</ext-link><sup><xref ref-type="bibr" rid="CR75">75</xref></sup>.</p></sec><sec sec-type="ethics-statement"><sec id="FPar4" sec-type="COI-statement"><title>Competing interests</title><p id="Par89">The authors declare no competing interests.</p></sec></sec><ref-list id="Bib1"><title>References</title><ref-list><ref id="CR1"><label>1.</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Chen</surname><given-names>Z</given-names></name><name><surname>Liu</surname><given-names>B</given-names></name></person-group><article-title xml:lang="en">Lifelong machine learning</article-title><source>Synth. Lect. Artif. Intell. Mach. Learn.</source><year>2018</year><volume>12</volume><fpage>1</fpage><lpage>207</lpage></mixed-citation></ref><ref id="CR2"><label>2.</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Hadsell</surname><given-names>R</given-names></name><name><surname>Rao</surname><given-names>D</given-names></name><name><surname>Rusu</surname><given-names>AA</given-names></name><name><surname>Pascanu</surname><given-names>R</given-names></name></person-group><article-title xml:lang="en">Embracing change: continual learning in deep neural networks</article-title><source>Trends Cognit. Sci.</source><year>2020</year><volume>24</volume><fpage>1028</fpage><lpage>1040</lpage><pub-id pub-id-type="doi">10.1016/j.tics.2020.09.004</pub-id></mixed-citation></ref><ref id="CR3"><label>3.</label><mixed-citation publication-type="other">McCloskey, M. &amp; Cohen, N. J. In <italic>Psychology of Learning and Motivation</italic> Vol. 24, 109–165 (Elsevier, 1989).</mixed-citation></ref><ref id="CR4"><label>4.</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>French</surname><given-names>RM</given-names></name></person-group><article-title xml:lang="en">Catastrophic forgetting in connectionist networks</article-title><source>Trends Cognit. Sci.</source><year>1999</year><volume>3</volume><fpage>128</fpage><lpage>135</lpage><pub-id pub-id-type="doi">10.1016/S1364-6613(99)01294-2</pub-id></mixed-citation></ref><ref id="CR5"><label>5.</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Kudithipudi</surname><given-names>D</given-names></name><etal/></person-group><article-title xml:lang="en">Biological underpinnings for lifelong learning machines</article-title><source>Nat. Mach. Intell.</source><year>2022</year><volume>4</volume><fpage>196–210</fpage><pub-id pub-id-type="doi">10.1038/s42256-022-00452-0</pub-id></mixed-citation></ref><ref id="CR6"><label>6.</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Lee</surname><given-names>CS</given-names></name><name><surname>Lee</surname><given-names>AY</given-names></name></person-group><article-title xml:lang="en">Clinical applications of continual learning machine learning</article-title><source>Lancet Digital Health</source><year>2020</year><volume>2</volume><fpage>e279</fpage><lpage>e281</lpage><pub-id pub-id-type="doi">10.1016/S2589-7500(20)30102-3</pub-id></mixed-citation></ref><ref id="CR7"><label>7.</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Shaheen</surname><given-names>K</given-names></name><name><surname>Hanif</surname><given-names>MA</given-names></name><name><surname>Hasan</surname><given-names>O</given-names></name><name><surname>Shafique</surname><given-names>M</given-names></name></person-group><article-title xml:lang="en">Continual learning for real-world autonomous systems: Algorithms, challenges and frameworks</article-title><source>J. Intell. Robot. Syst.</source><year>2022</year><volume>105</volume><fpage>9</fpage><pub-id pub-id-type="doi">10.1007/s10846-022-01603-6</pub-id></mixed-citation></ref><ref id="CR8"><label>8.</label><mixed-citation publication-type="other">Philps, D., Weyde, T., Garcez, A. d. &amp; Batchelor, R. Continual learning augmented investment decisions. Preprint at <ext-link xlink:href="https://arxiv.org/abs/1812.02340" ext-link-type="url">https://arxiv.org/abs/1812.02340</ext-link> (2018).</mixed-citation></ref><ref id="CR9"><label>9.</label><mixed-citation publication-type="other">Mundt, M., Lang, S., Delfosse, Q. &amp; Kersting, K. CLEVA-compass: A continual learning evaluation assessment compass to promote research transparency and comparability. In <italic>International Conference on Learning Representations</italic> (2022).</mixed-citation></ref><ref id="CR10"><label>10.</label><mixed-citation publication-type="other">Marr, D. Vision: A computational investigation into the human representation and processing of visual information (WH Freeman, 1982).</mixed-citation></ref><ref id="CR11"><label>11.</label><mixed-citation publication-type="other">Ruvolo, P. &amp; Eaton, E. ELLA: An efficient lifelong learning algorithm. In <italic>International Conference on Machine Learning</italic> 507–515 (PMLR, 2013).</mixed-citation></ref><ref id="CR12"><label>12.</label><mixed-citation publication-type="other">Masse, N. Y., Grant, G. D. &amp; Freedman, D. J. Alleviating catastrophic forgetting using context-dependent gating and synaptic stabilization. <italic>Proc. Natl Acad. Sci. USA</italic><bold>115</bold>, E10467–E10475 (2018).</mixed-citation></ref><ref id="CR13"><label>13.</label><mixed-citation publication-type="other">Ramesh, R. &amp; Chaudhari, P. Model Zoo: A growing brain that learns continually. In <italic>International Conference on Learning Representations</italic> (2022).</mixed-citation></ref><ref id="CR14"><label>14.</label><mixed-citation publication-type="other">Lopez-Paz, D. &amp; Ranzato, M. Gradient episodic memory for continual learning. In <italic>Advances in Neural Information Processing Systems</italic> Vol. 30, 6470–6479 (2017).</mixed-citation></ref><ref id="CR15"><label>15.</label><mixed-citation publication-type="other">Vogelstein, J. T. et al. Representation ensembling for synergistic lifelong learning with quasilinear complexity. Preprint at <ext-link xlink:href="https://arxiv.org/abs/2004.12908" ext-link-type="url">https://arxiv.org/abs/2004.12908</ext-link> (2020).</mixed-citation></ref><ref id="CR16"><label>16.</label><mixed-citation publication-type="other">Ke, Z., Liu, B., Xu, H. &amp; Shu, L. CLASSIC: Continual and contrastive learning of aspect sentiment classification tasks. In <italic>Proc. 2021 Conference on Empirical Methods in Natural Language Processing</italic> 6871–6883 (Association for Computational Linguistics, 2021).</mixed-citation></ref><ref id="CR17"><label>17.</label><mixed-citation publication-type="other">Mirza, M. J., Masana, M., Possegger, H. &amp; Bischof, H. An efficient domain-incremental learning approach to drive in all weather conditions. In <italic>Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) Workshops</italic> 3001–3011 (2022).</mixed-citation></ref><ref id="CR18"><label>18.</label><mixed-citation publication-type="other">Aljundi, R., Chakravarty, P. &amp; Tuytelaars, T. Expert gate: Lifelong learning with a network of experts. In <italic>Proc. IEEE Conference on Computer Vision and Pattern Recognition</italic> 3366–3375 (2017).</mixed-citation></ref><ref id="CR19"><label>19.</label><mixed-citation publication-type="other">von Oswald, J., Henning, C., Sacramento, J. &amp; Grewe, B. F. Continual learning with hypernetworks. In <italic>International Conference on Learning Representations</italic> (2020).</mixed-citation></ref><ref id="CR20"><label>20.</label><mixed-citation publication-type="other">Wortsman, M. et al. Supermasks in superposition. In <italic>Advances in Neural Information Processing Systems</italic> Vol. 33, 15173–15184 (2020).</mixed-citation></ref><ref id="CR21"><label>21.</label><mixed-citation publication-type="other">Henning, C. et al. Posterior meta-replay for continual learning. In <italic>Advances in Neural Information Processing Systems</italic> Vol. 34, 14135–14149 (2021).</mixed-citation></ref><ref id="CR22"><label>22.</label><mixed-citation publication-type="other">Verma, V. K., Liang, K. J., Mehta, N., Rai, P. &amp; Carin, L. Efficient feature transformations for discriminative and generative continual learning. In <italic>Proc. IEEE/CVF Conference on Computer Vision and Pattern Recognition</italic> 13865–13875 (2021).</mixed-citation></ref><ref id="CR23"><label>23.</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Heald</surname><given-names>JB</given-names></name><name><surname>Lengyel</surname><given-names>M</given-names></name><name><surname>Wolpert</surname><given-names>DM</given-names></name></person-group><article-title xml:lang="en">Contextual inference underlies the learning of sensorimotor repertoires</article-title><source>Nature</source><year>2021</year><volume>600</volume><fpage>489</fpage><lpage>493</lpage><pub-id pub-id-type="doi">10.1038/s41586-021-04129-3</pub-id></mixed-citation></ref><ref id="CR24"><label>24.</label><mixed-citation publication-type="other">Lomonaco, V. &amp; Maltoni, D. Core50: a new dataset and benchmark for continuous object recognition. In <italic>Conference on Robot Learning</italic> 17–26 (PMLR, 2017).</mixed-citation></ref><ref id="CR25"><label>25.</label><mixed-citation publication-type="other">Rebuffi, S.-A., Kolesnikov, A., Sperl, G. &amp; Lampert, C. H. icarl: Incremental classifier and representation learning. In <italic>Proc. IEEE Conference on Computer Vision and Pattern Recognition</italic> 2001–2010 (2017).</mixed-citation></ref><ref id="CR26"><label>26.</label><mixed-citation publication-type="other">Tao, X. et al. Few-shot class-incremental learning. In <italic>Proc. IEEE/CVF Conference on Computer Vision and Pattern Recognition</italic> 12183–12192 (2020).</mixed-citation></ref><ref id="CR27"><label>27.</label><mixed-citation publication-type="other">Shin, H., Lee, J. K., Kim, J. &amp; Kim, J. Continual learning with deep generative replay. In <italic>Advances in Neural Information Processing Systems</italic> Vol. 30, 2994–3003 (2017).</mixed-citation></ref><ref id="CR28"><label>28.</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>van de Ven</surname><given-names>GM</given-names></name><name><surname>Siegelmann</surname><given-names>HT</given-names></name><name><surname>Tolias</surname><given-names>AS</given-names></name></person-group><article-title xml:lang="en">Brain-inspired replay for continual learning with artificial neural networks</article-title><source>Nat. Commun.</source><year>2020</year><volume>11</volume><pub-id pub-id-type="doi">10.1038/s41467-020-17866-2</pub-id></mixed-citation></ref><ref id="CR29"><label>29.</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Belouadah</surname><given-names>E</given-names></name><name><surname>Popescu</surname><given-names>A</given-names></name><name><surname>Kanellos</surname><given-names>I</given-names></name></person-group><article-title xml:lang="en">A comprehensive study of class incremental learning algorithms for visual tasks</article-title><source>Neural Networks</source><year>2021</year><volume>135</volume><fpage>38</fpage><lpage>54</lpage><pub-id pub-id-type="doi">10.1016/j.neunet.2020.12.003</pub-id></mixed-citation></ref><ref id="CR30"><label>30.</label><mixed-citation publication-type="other">Masana, M. et al. Class-incremental learning: survey and performance evaluation on image classification. In <italic>IEEE Transactions on Pattern Analysis and Machine Intelligence</italic> (IEEE, 2022). <ext-link xlink:href="https://doi.org/10.1109/TPAMI.2022.3213473" ext-link-type="doi">https://doi.org/10.1109/TPAMI.2022.3213473</ext-link></mixed-citation></ref><ref id="CR31"><label>31.</label><mixed-citation publication-type="other">Zenke, F., Poole, B. &amp; Ganguli, S. Continual learning through synaptic intelligence. In <italic>International Conference on Machine Learning</italic> 3987–3995 (PMLR, 2017).</mixed-citation></ref><ref id="CR32"><label>32.</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Zeng</surname><given-names>G</given-names></name><name><surname>Chen</surname><given-names>Y</given-names></name><name><surname>Cui</surname><given-names>B</given-names></name><name><surname>Yu</surname><given-names>S</given-names></name></person-group><article-title xml:lang="en">Continual learning of context-dependent processing in neural networks</article-title><source>Nat. Mach. Intell.</source><year>2019</year><volume>1</volume><fpage>364</fpage><lpage>372</lpage><pub-id pub-id-type="doi">10.1038/s42256-019-0080-x</pub-id></mixed-citation></ref><ref id="CR33"><label>33.</label><mixed-citation publication-type="other">Aljundi, R., Kelchtermans, K. &amp; Tuytelaars, T. Task-free continual learning. In <italic>Proc. IEEE/CVF Conference on Computer Vision and Pattern Recognition</italic> 11254–11263 (2019).</mixed-citation></ref><ref id="CR34"><label>34.</label><mixed-citation publication-type="other">Zeno, C., Golan, I., Hoffer, E. &amp; Soudry, D. Task agnostic continual learning using online variational bayes. Preprint at <ext-link xlink:href="https://arxiv.org/abs/1803.10123v3" ext-link-type="url">https://arxiv.org/abs/1803.10123v3</ext-link> (2019).</mixed-citation></ref><ref id="CR35"><label>35.</label><mixed-citation publication-type="other">Rao, D. et al. Continual unsupervised representation learning. In <italic>Advances in Neural Information Processing Systems</italic> Vol. 32, 7647–7657 (2019).</mixed-citation></ref><ref id="CR36"><label>36.</label><mixed-citation publication-type="other">De Lange, M. &amp; Tuytelaars, T. Continual prototype evolution: Learning online from non-stationary data streams. In <italic>Proc. IEEE/CVF International Conference on Computer Vision</italic> 8250–8259 (2021).</mixed-citation></ref><ref id="CR37"><label>37.</label><mixed-citation publication-type="other">Li, S., Du, Y., van de Ven, G. M. &amp; Mordatch, I. Energy-based models for continual learning. Preprint at <ext-link xlink:href="https://arxiv.org/abs/2011.12216" ext-link-type="url">https://arxiv.org/abs/2011.12216</ext-link> (2020).</mixed-citation></ref><ref id="CR38"><label>38.</label><mixed-citation publication-type="other">Hayes, T. L. &amp; Kanan, C. Lifelong machine learning with deep streaming linear discriminant analysis. In <italic>Proc. IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) Workshops</italic> 220–221 (2020).</mixed-citation></ref><ref id="CR39"><label>39.</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Mai</surname><given-names>Z</given-names></name><etal/></person-group><article-title xml:lang="en">Online continual learning in image classification: An empirical survey</article-title><source>Neurocomputing</source><year>2022</year><volume>469</volume><fpage>28</fpage><lpage>51</lpage><pub-id pub-id-type="doi">10.1016/j.neucom.2021.10.021</pub-id></mixed-citation></ref><ref id="CR40"><label>40.</label><mixed-citation publication-type="other">Lesort, T., Caccia, M. &amp; Rish, I. Understanding continual learning settings with data distribution drift analysis. Preprint at <ext-link xlink:href="https://arxiv.org/abs/2104.01678" ext-link-type="url">https://arxiv.org/abs/2104.01678</ext-link> (2021).</mixed-citation></ref><ref id="CR41"><label>41.</label><mixed-citation publication-type="other">Lomonaco, V. et al. Avalanche: an end-to-end library for continual learning. In <italic>Proc. IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) Workshops</italic> 3600–3610 (2021).</mixed-citation></ref><ref id="CR42"><label>42.</label><mixed-citation publication-type="other">Gepperth, A. &amp; Hammer, B. Incremental learning algorithms and applications. In <italic>European Symposium on Artificial Neural Networks (ESANN)</italic> (2016).</mixed-citation></ref><ref id="CR43"><label>43.</label><mixed-citation publication-type="other">Stojanov, S. et al. Incremental object learning from contiguous views. In <italic>Proc. IEEE/CVF Conference on Computer Vision and Pattern Recognition</italic> 8777–8786 (2019).</mixed-citation></ref><ref id="CR44"><label>44.</label><mixed-citation publication-type="other">Caccia, L., Belilovsky, E., Caccia, M. &amp; Pineau, J. Online learned continual compression with adaptive quantization modules. In <italic>International Conference on Machine Learning</italic> 1240–1250 (PMLR, 2020).</mixed-citation></ref><ref id="CR45"><label>45.</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Cossu</surname><given-names>A</given-names></name><etal/></person-group><article-title xml:lang="en">Is class-incremental enough for continual learning?</article-title><source>Front. Artif. Intell.</source><year>2022</year><volume>5</volume><fpage>829842</fpage><pub-id pub-id-type="doi">10.3389/frai.2022.829842</pub-id></mixed-citation></ref><ref id="CR46"><label>46.</label><mixed-citation publication-type="other">Lee, S., Ha, J., Zhang, D. &amp; Kim, G.A neural dirichlet process mixture model for task-free continual learning. In <italic>International Conference on Learning Representations</italic> (2020).</mixed-citation></ref><ref id="CR47"><label>47.</label><mixed-citation publication-type="other">Jin, X., Sadhu, A., Du, J. &amp; Ren, X. Gradient-based editing of memory examples for online task-free continual learning. In <italic>Advances in Neural Information Processing Systems</italic> Vol. 34, 29193–29205 (2021).</mixed-citation></ref><ref id="CR48"><label>48.</label><mixed-citation publication-type="other">Shanahan, M., Kaplanis, C. &amp; Mitrović, J. Encoders and ensembles for task-free continual learning. Preprint at <ext-link xlink:href="https://arxiv.org/abs/2105.13327" ext-link-type="url">https://arxiv.org/abs/2105.13327</ext-link> (2021).</mixed-citation></ref><ref id="CR49"><label>49.</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Kirkpatrick</surname><given-names>J</given-names></name><etal/></person-group><article-title xml:lang="en">Overcoming catastrophic forgetting in neural networks</article-title><source>Proc. Natl Acad. Sci. USA</source><year>2017</year><volume>114</volume><fpage>3521</fpage><lpage>3526</lpage><pub-id pub-id-type="amsid">3635506</pub-id><pub-id pub-id-type="doi">10.1073/pnas.1611835114</pub-id><pub-id pub-id-type="zbl">1404.92015</pub-id></mixed-citation></ref><ref id="CR50"><label>50.</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Li</surname><given-names>Z</given-names></name><name><surname>Hoiem</surname><given-names>D</given-names></name></person-group><article-title xml:lang="en">Learning without forgetting</article-title><source>IEEE Trans. Pattern Anal. Mach. Intell.</source><year>2017</year><volume>40</volume><fpage>2935</fpage><lpage>2947</lpage><pub-id pub-id-type="doi">10.1109/TPAMI.2017.2773081</pub-id></mixed-citation></ref><ref id="CR51"><label>51.</label><mixed-citation publication-type="other">Pan, P. et al. Continual deep learning by functional regularisation of memorable past. In <italic>Advances in Neural Information Processing Systems</italic> Vol. 33, 4453–4464 (2020).</mixed-citation></ref><ref id="CR52"><label>52.</label><mixed-citation publication-type="other">Rolnick, D., Ahuja, A., Schwarz, J., Lillicrap, T. &amp; Wayne, G. Experience replay for continual learning. In <italic>Advances in Neural Information Processing Systems</italic> Vol. 32 (2019).</mixed-citation></ref><ref id="CR53"><label>53.</label><mixed-citation publication-type="other">Chaudhry, A. et al. On tiny episodic memories in continual learning. Preprint at <ext-link xlink:href="https://arxiv.org/abs/1902.10486" ext-link-type="url">https://arxiv.org/abs/1902.10486</ext-link> (2019).</mixed-citation></ref><ref id="CR54"><label>54.</label><mixed-citation publication-type="other">Chaudhry, A., Ranzato, M., Rohrbach, M. &amp; Elhoseiny, M. Efficient lifelong learning with a-gem. In <italic>International Conference on Learning Representations</italic> (2019).</mixed-citation></ref><ref id="CR55"><label>55.</label><mixed-citation publication-type="other">van de Ven, G. M., Li, Z. &amp; Tolias, A. S. Class-incremental learning with generative classifiers. In <italic>Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) Workshops</italic> 3611–3620 (2021).</mixed-citation></ref><ref id="CR56"><label>56.</label><mixed-citation publication-type="other">Lesort, T., Caselles-Dupré, H., Garcia-Ortiz, M., Stoian, A. &amp; Filliat, D. Generative models from the perspective of continual learning. In <italic>International Joint Conference on Neural Networks</italic> (IEEE, 2019).</mixed-citation></ref><ref id="CR57"><label>57.</label><mixed-citation publication-type="other">Aljundi, R. et al. Online continual learning with maximally interfered retrieval. In <italic>Advances in Neural Information Processing Systems</italic> Vol. 32 (2019).</mixed-citation></ref><ref id="CR58"><label>58.</label><mixed-citation publication-type="other">van de Ven, G. M. &amp; Tolias, A. S. Generative replay with feedback connections as a general strategy for continual learning. Preprint at <ext-link xlink:href="https://arxiv.org/abs/1809.10635" ext-link-type="url">https://arxiv.org/abs/1809.10635</ext-link> (2018).</mixed-citation></ref><ref id="CR59"><label>59.</label><mixed-citation publication-type="other">van de Ven, G. M. &amp; Tolias, A. S. Three scenarios for continual learning. Preprint at <ext-link xlink:href="https://arxiv.org/abs/1904.07734" ext-link-type="url">https://arxiv.org/abs/1904.07734</ext-link> (2019).</mixed-citation></ref><ref id="CR60"><label>60.</label><mixed-citation publication-type="other">Farquhar, S. &amp; Gal, Y. Towards robust evaluations of continual learning. Preprint at <ext-link xlink:href="https://arxiv.org/abs/1805.09733" ext-link-type="url">https://arxiv.org/abs/1805.09733</ext-link> (2018).</mixed-citation></ref><ref id="CR61"><label>61.</label><mixed-citation publication-type="other">Goodfellow, I. J., Mirza, M., Xiao, D., Courville, A. &amp; Bengio, Y. An empirical investigation of catastrophic forgetting in gradient-based neural networks. Preprint at <ext-link xlink:href="https://arxiv.org/abs/1312.6211" ext-link-type="url">https://arxiv.org/abs/1312.6211</ext-link> (2013).</mixed-citation></ref><ref id="CR62"><label>62.</label><mixed-citation publication-type="other">Douillard, A. &amp; Lesort, T. Continuum: Simple management of complex continual learning scenarios. Preprint at <ext-link xlink:href="https://arxiv.org/abs/2102.06253" ext-link-type="url">https://arxiv.org/abs/2102.06253</ext-link> (2021).</mixed-citation></ref><ref id="CR63"><label>63.</label><mixed-citation publication-type="other">Normandin, F. et al. Sequoia: A software framework to unify continual learning research. Preprint at <ext-link xlink:href="https://arxiv.org/abs/2108.01005" ext-link-type="url">https://arxiv.org/abs/2108.01005</ext-link> (2021).</mixed-citation></ref><ref id="CR64"><label>64.</label><mixed-citation publication-type="other">Hess, T., Mundt, M., Pliushch, I. &amp; Ramesh, V. A procedural world generation framework for systematic evaluation of continual learning. In <italic>Thirty-fifth Conference on Neural Information Processing Systems, Datasets and Benchmarks Track</italic> (2021).</mixed-citation></ref><ref id="CR65"><label>65.</label><mixed-citation publication-type="other">Paszke, A. et al. Automatic differentiation in pytorch. In <italic>NeurIPS Autodiff Workshop</italic> (2017).</mixed-citation></ref><ref id="CR66"><label>66.</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>LeCun</surname><given-names>Y</given-names></name><name><surname>Bottou</surname><given-names>L</given-names></name><name><surname>Bengio</surname><given-names>Y</given-names></name><name><surname>Haffner</surname><given-names>P</given-names></name><etal/></person-group><article-title xml:lang="en">Gradient-based learning applied to document recognition</article-title><source>Proc. IEEE</source><year>1998</year><volume>86</volume><fpage>2278</fpage><lpage>2324</lpage><pub-id pub-id-type="doi">10.1109/5.726791</pub-id></mixed-citation></ref><ref id="CR67"><label>67.</label><mixed-citation publication-type="other">Krizhevsky, A., Hinton, G. et al. <italic>Learning Multiple Layers of Features from Tiny Images</italic> (University of Toronto, 2009).</mixed-citation></ref><ref id="CR68"><label>68.</label><mixed-citation publication-type="other">Ioffe, S. &amp; Szegedy, C. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In <italic>International Conference on Machine Learning</italic> 448–456 (PMLR, 2015).</mixed-citation></ref><ref id="CR69"><label>69.</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Maltoni</surname><given-names>D</given-names></name><name><surname>Lomonaco</surname><given-names>V</given-names></name></person-group><article-title xml:lang="en">Continuous learning in single-incremental-task scenarios</article-title><source>Neural Networks</source><year>2019</year><volume>116</volume><fpage>56</fpage><lpage>73</lpage><pub-id pub-id-type="doi">10.1016/j.neunet.2019.03.010</pub-id></mixed-citation></ref><ref id="CR70"><label>70.</label><mixed-citation publication-type="other">Kingma, D. P. &amp; Ba, J. Adam: A method for stochastic optimization. Preprint at <ext-link xlink:href="https://arxiv.org/abs/1412.6980" ext-link-type="url">https://arxiv.org/abs/1412.6980</ext-link> (2014).</mixed-citation></ref><ref id="CR71"><label>71.</label><mixed-citation publication-type="other">Hinton, G., Vinyals, O. &amp; Dean, J. Distilling the knowledge in a neural network. Preprint at <ext-link xlink:href="https://arxiv.org/abs/1503.02531" ext-link-type="url">https://arxiv.org/abs/1503.02531</ext-link> (2015).</mixed-citation></ref><ref id="CR72"><label>72.</label><mixed-citation publication-type="other">Kingma, D. P. &amp; Welling, M. Auto-encoding variational bayes. Preprint at <ext-link xlink:href="https://arxiv.org/abs/1312.6114" ext-link-type="url">https://arxiv.org/abs/1312.6114</ext-link> (2013).</mixed-citation></ref><ref id="CR73"><label>73.</label><mixed-citation publication-type="other">Zeiler, M. D., Taylor, G. W., Fergus, R. et al. Adaptive deconvolutional networks for mid and high level feature learning. In <italic>International Conference on Computer Vision</italic> 2018–2025 (IEEE, 2011).</mixed-citation></ref><ref id="CR74"><label>74.</label><mixed-citation publication-type="other">Rezende, D. &amp; Mohamed, S. Variational inference with normalizing flows. In <italic>International Conference on Machine Learning</italic> 1530–1538 (PMLR, 2015).</mixed-citation></ref><ref id="CR75"><label>75.</label><mixed-citation publication-type="other">van de Ven, G. M. GMvandeVen/continual-learning: v1.0.0 (2022). <ext-link xlink:href="https://doi.org/10.5281/zenodo.7189378" ext-link-type="doi">https://doi.org/10.5281/zenodo.7189378</ext-link></mixed-citation></ref></ref-list></ref-list><app-group><app id="App1"><sec id="Sec36"><title>Extended data</title><p id="Par90"><fig id="Fig4"><label>Extended Data Fig. 1</label><caption xml:lang="en"><title>Comparison of methods using stored data with different buffer sizes.</title><p>Shown is the average test accuracy (as %, over all contexts) of different methods that use stored data on Split MNIST (<bold>a</bold>) and on Split CIFAR-100 (<bold>b</bold>) as a function of the number of examples per class that is allowed to be stored in memory. Due to its high computational costs, we were not able to run FROMP on Split CIFAR-100, or on Split MNIST with a memory budget above 1,000 samples per class. Displayed are the means over 5 repetitions, shaded areas are ± 1 SEM. ER: exact replay, A-GEM: averaged gradient episodic memory, FROMP: functional regularization of the memorable past, iCaRL: incremental classifier and representation learning, None: sequential training in the standard way, Joint: training on all data at the same time.</p></caption><p><graphic position="anchor" specific-use="HTML" mime-subtype="JPEG" xlink:href="MediaObjects/42256_2022_568_Fig4_ESM.jpg"/></p></fig></p></sec><sec id="Sec37"><title>Supplementary information</title><p id="Par91"><supplementary-material content-type="local-data" id="MOESM1" xlink:title="Supplementary information"><media xlink:href="MediaObjects/42256_2022_568_MOESM1_ESM.pdf" mimetype="application" mime-subtype="pdf"><caption xml:lang="en"><p>Supplementary Notes 1–8 and references.</p></caption></media></supplementary-material></p></sec></app></app-group><notes notes-type="ESMHint"><sec id="FPar1"><title>Extended data</title><p id="Par86">is available for this paper at <ext-link xlink:href="https://doi.org/10.1038/s42256-022-00568-3" ext-link-type="doi">https://doi.org/10.1038/s42256-022-00568-3</ext-link>.</p></sec><sec id="FPar2"><title>Supplementary information</title><p id="Par87">The online version contains supplementary material available at <ext-link xlink:href="https://doi.org/10.1038/s42256-022-00568-3" ext-link-type="doi">https://doi.org/10.1038/s42256-022-00568-3</ext-link>.</p></sec></notes><notes notes-type="Misc"><p><bold>Publisher’s note</bold> Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.</p></notes></back></article>