Riemannian Walk for Incremental Learning: Understanding Forgetting - - PowerPoint PPT Presentation

riemannian walk for incremental learning understanding
SMART_READER_LITE
LIVE PREVIEW

Riemannian Walk for Incremental Learning: Understanding Forgetting - - PowerPoint PPT Presentation

Riemannian Walk for Incremental Learning: Understanding Forgetting and Intransigence Riemannian Walk for Incremental Learning: Understanding Forgetting and Intransigence Arslan Chaudhry et al. Presented by Milo Prgr Pattern Recognition and


slide-1
SLIDE 1

Riemannian Walk for Incremental Learning: Understanding Forgetting and Intransigence

Riemannian Walk for Incremental Learning: Understanding Forgetting and Intransigence

Arslan Chaudhry et al.

Presented by Miloš Prágr

Pattern Recognition and Computer Vision Reading Group Faculty of Electrical Engineering Czech Technical University in Prague

January 14, 2020

  • M. Prágr

1 / 36

slide-2
SLIDE 2

Outline

Incremental Learning Elastic Weight Consolidation Path Integral Riemannian Walk

  • M. Prágr

2 / 36

slide-3
SLIDE 3

Incremental Learning Online learning approaches use training samples one by one, without knowing their number in advance, to optimise their internal cost function Incremental learning refers to online learning strategies which work with limited memory resources

Gepperth and Hammer, Incremental learning algorithms and applications, ESANN 2016

  • M. Prágr

3 / 36

slide-4
SLIDE 4

Challenges of Incremental Learning

  • 1. Online model parameter adaptation
  • 2. Concept drift
  • 3. Stability-plasticity dilema
  • 4. Adaptive model complexity and meta-parameters
  • 5. Efficient memory models
  • 6. Model benchmarking

Gepperth and Hammer, Incremental learning algorithms and applications, ESANN 2016

  • M. Prágr

4 / 36

slide-5
SLIDE 5

Online Model Parameter Adaptation

  • 1. Online model parameter adaptation
  • 2. Concept drift
  • 3. Stability-plasticity dilema
  • 4. Adaptive model complexity and meta-parameters
  • 5. Efficient memory models
  • 6. Model benchmarking

medium.com/starschema-blog Fritzke, A Growing Neural Gas Network Learns Topologies, NIPS 1994

Mt ← update(Mt−1, (xt, yt))

  • M. Prágr

5 / 36

slide-6
SLIDE 6

Concept Drift

  • 1. Online model parameter adaptation
  • 2. Concept drift
  • 3. Stability-plasticity dilema
  • 4. Adaptive model complexity and meta-parameters
  • 5. Efficient memory models
  • 6. Model benchmarking

Webb et al., 2016

The distribution underlying the data changes during learning

  • M. Prágr

6 / 36

slide-7
SLIDE 7

Concept Drift

  • 1. Online model parameter adaptation
  • 2. Concept drift
  • 3. Stability-plasticity dilema
  • 4. Adaptive model complexity and meta-parameters
  • 5. Efficient memory models
  • 6. Model benchmarking

Moreno-Torres et al., 2012 Covariate shift of p(x)

The distribution underlying the data changes during learning

  • M. Prágr

6 / 36

slide-8
SLIDE 8

Concept Drift

  • 1. Online model parameter adaptation
  • 2. Concept drift
  • 3. Stability-plasticity dilema
  • 4. Adaptive model complexity and meta-parameters
  • 5. Efficient memory models
  • 6. Model benchmarking

Moreno-Torres et al., 2012 Concept shift of p(y|x)

The distribution underlying the data changes during learning

  • M. Prágr

6 / 36

slide-9
SLIDE 9

Stability-plasticity Dilema

  • 1. Online model parameter adaptation
  • 2. Concept drift
  • 3. Stability-plasticity dilema
  • 4. Adaptive model complexity and meta-parameters
  • 5. Efficient memory models
  • 6. Model benchmarking

Quick updates cause old information to be forgotten equally quickly Gradual forgetting is natural component of both artificial and natural systems Catastrophic forgetting - completely disrupting or erasing previously learned information

French, Catastrophic forgetting in connectionist networks, Trends in Cognitive Sciences 1999

  • M. Prágr

7 / 36

slide-10
SLIDE 10

Adaptive Model Complexity and Meta-parameters

  • 1. Online model parameter adaptation
  • 2. Concept drift
  • 3. Stability-plasticity dilema
  • 4. Adaptive model complexity and meta-parameters
  • 5. Efficient memory models
  • 6. Model benchmarking

It is impossible to estimate the model complexity in advance Minimal complexity increased by concept drift Maximal complexity bounded by resources

  • M. Prágr

8 / 36

slide-11
SLIDE 11

Efficient Memory Models

  • 1. Online model parameter adaptation
  • 2. Concept drift
  • 3. Stability-plasticity dilema
  • 4. Adaptive model complexity and meta-parameters
  • 5. Efficient memory models
  • 6. Model benchmarking
  • M. Prágr

9 / 36

slide-12
SLIDE 12

Model Benchmarking

  • 1. Online model parameter adaptation
  • 2. Concept drift
  • 3. Stability-plasticity dilema
  • 4. Adaptive model complexity and meta-parameters
  • 5. Efficient memory models
  • 6. Model benchmarking
  • 1. Incremental vs non-incremental
  • 2. Incremental vs incremental
  • M. Prágr

10 / 36

slide-13
SLIDE 13

Motivation: Deployment of Incremental Learning

Environment representation Traversal cost modeling Model inference Exploration

Traversal cost map Confidence map Terrain descriptors Traversability map

[0.12, 2.34, … , 0.30] [1.14, 3.76, … , 0.11] … [0.33, 1.07, … ,0.76]

2.5D map

Exteroception Proprioception

Traversal cost model Frontier selection

Robust Bayesian Committee Machine GP1 GP2 GPk …

Goal selection and Path planning

Online Incremental Learning of the Terrain Traversal Cost in Autonomous Exploration, RSS 2019

  • M. Prágr

11 / 36

slide-14
SLIDE 14

Forgetting and Intransigence

Forgetting: catastrophically forgetting knowledge of previous tasks Intransigence: inability to update the knowledge to learn the new task

Chaudhry et al., Riemannian Walk for Incremental Learning: Understanding Forgetting and Intransigence, ECCV 2018

  • M. Prágr

12 / 36

slide-15
SLIDE 15

Forgetting and Intransigence Measures: Preliminaries

General setup: stream of tasks, each corresponding to a set of labels Let the dataset Dk corresponding to the k-th task be as follows

Dk = {(xk

i , yk i )}nk i=1,

where k is the task identifier, xk

i ∈ X the inputs, and yk i ∈ Y the ground truth labels

Single-head evaluation - the task identity k is unknown in testing Multi-head evaluation - the task identity k is given in testing

  • M. Prágr

13 / 36

slide-16
SLIDE 16

Forgetting and Intransigence Measures: Preliminaries

General setup: stream of tasks, each corresponding to a set of labels Let the dataset Dk corresponding to the k-th task be as follows

Dk = {(xk

i , yk i )}nk i=1,

where k is the task identifier, xk

i ∈ X the inputs, and yk i ∈ Y the ground truth labels

Single-head evaluation - the task identity k is unknown in testing Multi-head evaluation - the task identity k is given in testing

  • M. Prágr

13 / 36

slide-17
SLIDE 17

Average Accuracy

Accuracy ak,j on the test set of the j-th task after training incrementally to task k is

ak,j s.t. j ≤ k

Average accuracy Ak at task k is defined as

Ak = 1 k

k

  • j=1

ak,j

  • M. Prágr

14 / 36

slide-18
SLIDE 18

Forgetting Measure

Forgetting fk

j for the j-th task training up to task k is

fk

j = maxl∈1,··· ,k−1al,j − ak,j,

s.t. j < k

Average forgetting Fk at the k-th task is defined as

Fk = 1 k − 1

k−1

  • j=1

fk

j

Backward transfer - influence of learning task k has on performance of task j < k

fk

j < 0 implies positive backward transfer: the performance on a previous task was

improved by learning additional tasks

  • M. Prágr

15 / 36

slide-19
SLIDE 19

Intransigence Measure

Reference model accuracy a∗

k is learned using the whole dataset as

∪k

l=1Dl

Intransigence Ik at the k-th task is defined as

Ik = a∗

k − ak,k

Ik

j < 0 implies positive forward transfer: learning incrementally up to task k positively

influences model’s knowledge about it

  • M. Prágr

16 / 36

slide-20
SLIDE 20

Outline

Incremental Learning Elastic Weight Consolidation Path Integral Riemannian Walk

  • M. Prágr

17 / 36

slide-21
SLIDE 21

Elastic Weight Consolidation Motivation: continual learning in the neocortex relies on task-specific synaptic consolida- tion, where knowledge is encoded by rendering a proportion of synapses less plastic Remember old tasks by selectively slowing down learning on the weights important for those tasks Aim for fast learning rates on parameters unconstrained by the previous tasks and slow rate from crucial parameters

Kirkpatrick et al., Overcoming catastrophic forgetting in neural networks, PNAS 2016

  • M. Prágr

18 / 36

slide-22
SLIDE 22

Elastic Weight Consolidation Remember old tasks by selectively slowing down learning on the weights important for those tasks

Given dataset D, select the configuration θ∗ as

θ∗ = argmaxθ p(θ|D)

Bayes gives the conditional probability p(θ|D) as

log p(θ|D) = log p(D|θ) + log p(θ) − log p(D) negative loss function −L(θ)

  • M. Prágr

19 / 36

slide-23
SLIDE 23

Elastic Weight Consolidation

Spliting the data into tasks A and B gives

log p(θ|D) = log p(DB|θ) + log p(θ|DA) − log p(DB) negative loss function for task B −LB(θ) intractable posterior of task A

Approximating the posterior as a Gaussian distribution given as

N(θ∗

A, (diag(F))−1) MacKay, A practical Bayesian framework for backpropagation networks, Neural Computing 1992

where the precision diag(F) is the diagonal of the Fisher information matrix F defined as [F]ij = E(x,y)∼D δ δθi log pθ(y|x) δ δθj log pθ(y|x)

  • M. Prágr

20 / 36

slide-24
SLIDE 24

Elastic Weight Consolidation

The Fisher information measures sensitivity of function f(x|θ) to changes of θ Approximating the posterior as a Gaussian distribution given as

N(θ∗

A, (diag(F))−1) MacKay, A practical Bayesian framework for backpropagation networks, Neural Computing 1992

where the precision diag(F) is the diagonal of the Fisher information matrix F defined as [F]ij = E(x,y)∼D δ δθi log pθ(y|x) δ δθj log pθ(y|x)

  • The Fisher matrix is equivalent to the second derivative of the loss near a minimum and is

always positive semidefinite

Pascanu and Bengio, Revisiting natural gradient for deep networks, 2013

The loss function to be minimized is

L(θ) = LB(θ) +

  • i

λ 2 (Fii)(θi − θ∗

A,i)2

  • M. Prágr

21 / 36

slide-25
SLIDE 25

Outline

Incremental Learning Elastic Weight Consolidation Path Integral Riemannian Walk

  • M. Prágr

22 / 36

slide-26
SLIDE 26

Path Integral

Accumulate parameter importance over the learning trajectory Avoid drastic changes to weights which were particularly influential in the past

Zenke et al., Continual Learning Through Synaptic Intelligence, ICML 2017

  • M. Prágr

23 / 36

slide-27
SLIDE 27

Path Integral

When learning task µ, the importance Ωµ

k of θk depends for each previous task ν on

The contribution over the entire training trajectory, i.e., ων

k where ν < µ

How far θk moved when learning ν: ∆ν

k = θk(tν) − θk(tν−1)

We want large gains (contribution) for little work (motion)

  • M. Prágr

24 / 36

slide-28
SLIDE 28

Path Integral

When learning task µ, the importance Ωµ

k of θk depends for each previous task ν on

The contribution over the entire training trajectory, i.e., ων

k where ν < µ

How far θk moved when learning ν: ∆ν

k = θk(tν) − θk(tν−1)

which leads to Ωµ

k =

  • ν<µ

ων

k

(∆ν

k)2 + ǫ

The surrogate loss for two tasks is used as

  • Lµ = Lµ + c
  • k

Ωµ

k(θk(tµ−1) − θk)2

  • M. Prágr

25 / 36

slide-29
SLIDE 29

Path Integral Why is this a path integral? And what is ων

k?

For infinitesimal parameter update δ(t) the loss change is approximated as loss gradient

L(θ(t) + δ(t)) − L(θ(t)) ≈

  • k

gk(t)δk(t)

Consider the path integral of the loss gradient along the parameter trajectory

  • C

g(θ(t))dθ = t1

t0

g(θ(t))θ′(t)dt, and its decomposition as a sum over individual parameters tµ

tµ−1 g(θ(t))θ′(t)dt =

  • k

tµ−1 gk(θ(t))θ′ k(t)dt ≡ −

  • k

ωµ

k

ωµ

k may be approximated as the running sum of the product of the gradient gk(t)

  • M. Prágr

26 / 36

slide-30
SLIDE 30

Outline

Incremental Learning Elastic Weight Consolidation Path Integral Riemannian Walk

  • M. Prágr

27 / 36

slide-31
SLIDE 31

Riemannian Walk

  • 1. Idea: Fisher Matrix may be infeasible for large number of parameters in deep neural net-

works

  • 2. Idea: Ground the approach using KL-divergence between network likelihoods instead of

empirical Fisher matrix Second-order Taylor approximation of the KL divergence is DKL(pθpθ+∆θ) ≈ 1 2

P

  • i=0

Fθi∆θ2

i

s.t. ∆θ → 0

  • 3. Idea: combine the EWC update with PI parameter importance
  • M. Prágr

28 / 36

slide-32
SLIDE 32

EWC++

EWC stores the Fisher matrix for each task independently and uses joint regularization To estimate the Fisher matrix, pass over the dataset is needed for each task A single diagonal Fisher matrix may be constructed using a batch approach as follows

F t = αF ′t + (1 − α)F t−1

Chaudhry et al., Riemannian Walk for Incremental Learning: Understanding Forgetting and Intransigence, ECCV 2018

  • M. Prágr

29 / 36

slide-33
SLIDE 33

EWC in Riemannian Walk

The EWC loss for the k-th task is generalized as

  • Lk(θ) = Lk(θ) + λDKL(pθk−1, pθ)

DKL(pθpθ+∆θ) ≈ 1 2

P

  • i=0

Fθi∆θ2

i

whereas the EWC loss is L(θ) = LB(θ) +

  • i

λ 2 (Fii)(θi − θ∗

A,i)2

EWC++ batch updated Fisher is used

F t = αF ′t + (1 − α)F t−1

  • M. Prágr

30 / 36

slide-34
SLIDE 34

Path Integral in Riemannian Walk

Path integral parameter importance: We want large

gains (contribution) for little work (motion) Ωµ

k =

  • ν<µ

ων

k

(∆ν

k)2 + ǫ

RWalk parameter importance:

Large loss improve- ment for small change of distribution st2

t1 = t2

  • t=t1

∆Lt+∆t

t

(θi)

1 2F t θi∆(θi(t))2 + ǫ

  • M. Prágr

31 / 36

slide-35
SLIDE 35

Riemannian Walk

The EWC loss for the k-th task is generalized as

  • Lk(θ) = Lk(θ) + λDKL(pθk−1, pθ)

The path integral parameter change is interpreted as a change in the model distribution,

and the importance change between t1 and t2 is defined as st2

t1 = t2

  • t=t1

∆Lt+∆t

t

(θi)

1 2F t θi∆(θi(t))2 + ǫ

The combined Riemannian walk loss function is

  • Lk(θ) = Lk(θ) + λ

P

  • i=1

(Fθk−1

i

+ stk−1

t0

(θi))(θi − θk−1

i

)2 where stk−1

t0

(θi)) = 1 2(stk−2

t0

(θi) + stk−1

tk−2(θi)) Note, the F and s should be normalized.

  • M. Prágr

32 / 36

slide-36
SLIDE 36

Handling Intransigence

Observation: learning task k with

  • nly Dk leads to poor accuracy in

single head

Avoid confusion by adding a set

representative samples of previous tasks

Strategies Uniform Plane-distance based Entropy-based (soft-max) Mean-of-features

  • M. Prágr

33 / 36

slide-37
SLIDE 37

Riemannian Walk: MNIST and CIFAR-100 Tests

MNIST tasks: {0, 1}, · · · , {8, 9} CIFAR-100 tasks: {0 − 9}, · · · , {90 − 99}

  • M. Prágr

34 / 36

slide-38
SLIDE 38

Riemannian Walk: MNIST Tests

Top to bottom: multi-head, single-head, single-head with samples

  • M. Prágr

35 / 36

slide-39
SLIDE 39

Forgetting and Intransigence

  • M. Prágr

36 / 36