-
Notifications
You must be signed in to change notification settings - Fork 8
/
03-2020_JHU_present.html
2080 lines (1187 loc) · 50.6 KB
/
03-2020_JHU_present.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html>
<head>
<title>L2M 2yr</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="fonts/quadon/quadon.css">
<link rel="stylesheet" href="fonts/gentona/gentona.css">
<link rel="stylesheet" href="slides_style_i.css">
<script type="text/javascript" src="assets/plotly/plotly-latest.min.js"></script>
</head>
<body>
<textarea id="source">
<!-- TODO add slide numbers & maybe slide name -->
### Lifelong Learning Machines
![:scale 60%](images/neurodata_blue.png)
Joshua T. Vogelstein | {[BME](https://www.bme.jhu.edu/),[CIS](http://cis.jhu.edu/), [ICM](https://icm.jhu.edu/), [KNDI](http://kavlijhu.org/)}@[JHU](https://www.jhu.edu/) | [neurodata](https://neurodata.io)
<br>
[jovo@jhu.edu](mailto:[email protected]) | <http://neurodata.io/talks> | [@neuro_data](https://twitter.com/neuro_data)
---
## Outline
- [Summary](#summary)
- [Definition](#def)
- [Scenarios](#scenarios)
- [Metrics](#metrics)
- [Algorithm](#alg)
- [Simulations](#sims)
- [Real](#real)
- [Theory](#theory)
- [Neurobiology](#neuro)
- [Discussion](#disc)
---
## Outline
- Summary
- [Definition](#def)
- [Scenarios](#scenarios)
- [Metrics](#metrics)
- [Algorithm](#alg)
- [Simulations](#sims)
- [Real](#real)
- [Theory](#theory)
- [Neurobiology](#neuro)
- [Discussion](#disc)
---
## What is lifelong Learning?
Lifelong learning occurs when
1. there is a stream of .ye[continually changing] tasks, and
2. performance improves by .ye[leveraging other tasks].
--
A system has .ye[weakly] lifelong learned if task performance .ye[on average], and has .ye[strongly] lifelong learned task performance improves .ye[for each task].
--
Thus, the only way to lifelong learn is by .ye[transferring knowledge across tasks], ideally both .ye[forward] (to improve future task performance) and .ye[backward] (to improve past task performance).
---
## Key Accomplishments
1. Formalized Lifelong Learning as generalization of classical machine learning
1. Introduced novel evaluation criteria: forward and backward transfer efficiency
1. Proposed omnidirectional transfer learning framework by ensembling representations
1. Implemented Lifelong Forests (LF) as a specific example
1. Demonstrated LF uniquely exhibits
1. positive forward transfer
1. positive backward transfer
1. positive overall transfer
1. Conjectured theory promising to prove consistency and robustness
1. Described equivalence between Decision Forests and Deep Nets
1. Proposed extension to implement and improve via Deep Nets
---
## Current State of the Art
Used either
1. fixed architecture/capacity,
2. increase capacity, with complicated architecture.
But did not demonstrate transfer (so maybe did not lifelong learn).
---
## Key Insights
1. Avoiding catastrophic forgetting: data don't hurt performance on old tasks. Why stop there?
1. The key to lifelong learning is the ability to transfer knowledge from one setting to others (both past and future).
2. This can be achieved by
1. learning new representation functions (as necessary)
1. ensembling representations to take actions.
Motivation: in biology, learning subsequent tasks often improves performance on past and future tasks.
The key is updating internal representations with each sample that are useful for multiple tasks.
---
## Proposed Metrics
**Transfer Efficiency**: The extent to which performance on a specific task improves by virtue of data from .ye[all other task data].
**Forward Transfer Efficiency**: The extent to which performance on a specific task improves by virtue of data from .ye[all past task data].
**Backward Transfer Efficiency**: The extent to which performance on a specific task improves by virtue of data from .ye[all future task data].
---
## Key Claims
1. If you don't transfer, you haven't lifelong learned, rather, you've .ye[sequentially compressed].
2. We propose the only algorithm in the literature the demonstrates weak or strong lifelong learning.
---
name:def
## Outline
- [Summary](#summary)
- Definition
- [Scenarios](#scenarios)
- [Metrics](#metrics)
- [Algorithm](#alg)
- [Simulations](#sims)
- [Real](#real)
- [Theory](#theory)
- [Neurobiology](#neuro)
- [Discussion](#disc)
---
## What is Learning?
Given $n$ new data points in setting $\mathcal{S}$, assuming $P$,
$f$ learns when its performance $\mathcal{E}$ improves due to the data:
.center[$f$ learns when $\mathcal{E}(f_n) < \mathcal{E}(f_0)$.]
--
$\mathcal{E}(f_0)$ is the performance of $f$ prior to seeing $n$ new data.
---
## What is Learning?
Given $n$ new .ye[data] points in .ye[setting] $\mathcal{S}$, .ye[assuming] $P$,
.ye[$f$] learns when its .ye[performance] $\mathcal{E}$ improves due to the data:
.center[$f$ learns when $\mathcal{E}(f_n) < \mathcal{E}(f_0)$.]
$\mathcal{E}(f_0)$ is the performance of $f$ prior to seeing $n$ new data.
---
## What are data?
- $z_i \in \mathcal{Z}$ for $i \in [n]$ are samples
- Classification Example
- $Z_i = (X_i,Y_i)$ where $\mathcal{X}=\mathbb{R}^p$ and $\mathcal{Y}=\lbrace 0,1\rbrace$
---
## What is a Setting?
The setting is determined by the available resources:
- .ye[Sample space]: $\mathcal{Z}$, determined by available sensors
- e.g., scalars, d-dimensional vectors, networks
- .ye[Action space]: $\mathcal{A}$, determined by available actuators
- e.g., {→, ←, ↑, ↓, A,B}, {reject, fail to reject}, $\mathbb{R}$
- .ye[Query space]: $\mathcal{Q}$, determined by system's "interface"
- e.g., in which cluster is $z$? what is this object?
- .ye[Constraints]: $\mathcal{C}$, determined by hardware, time, money, subject matter expertise
- e.g., $\mathcal{O}(n)$ training time, k-sparse, 8 GB
.ye[Setting]: an element of the tuple $\mathcal{S} := (\mathcal{Z}, \mathcal{A}, \mathcal{Q}, \mathcal{C})$
---
## What are the Assumptions?
These are required to have any theoretical performance guarantees, though they can be quite general:
- The data, $(Z_1,\ldots, Z_n) \in \mathcal{Z}^n$, are sampled from some true but unknown distribution $P_Z \in \, \mathcal{P}_Z$
- A query, $q \in \mathcal{Q}$ is sampled from some true but unknown distribution $P_Q \in \, \mathcal{P}_Q$
- An optimal action , $a \in \mathcal{A}$ given $q$, is sampled from some true but unknown distribution $P\_{A \mid Q} \in \, \mathcal{P}_{A \mid Q}$
Let $P = P\_Z \otimes P\_{A, Q} \in \, \mathcal{P}$ denote the joint distribution over samples, queries, and optimal actions.
---
## What is $f$?
We get to choose this, though we must respect the resource constraints defined by the setting:
- A .ye[hypothesis], $h : \mathcal{Q} \rightarrow \mathcal{A}$ takes an action on the basis of a query
- $f_n$ is a .ye[learner], which maps from a subset of $n$ samples in $\mathcal{Z}$ to a hypothesis $h \in \mathcal{H}$
- $f=f_1, f_2, \ldots$ is a sequence of learners, called a learning .ye[algorithm]
$$f \in \mathcal{F} = \lbrace f_n : \mathcal{Z}^n \rightarrow \mathcal{H}\rbrace$$
--
- Supervised machine learning example
- $f$ is *RandomForestClassifier.fit*
- $h$ is *RandomForestClassifier.predict*
<!-- --- -->
<!--
## What are Constraints?
Provided by subject matter expect and available resources, including:
- Distributional constraints $P \in \, \mathcal{P}$,
- e.g, mixture of K Gaussians, or convex
- Decision rule (or hypothesis) constraints, $h \in \mathcal{H}$,
- e.g., $\mathcal{O}(1)$, or k-sparse
- Learning rule constraints, $f \in \mathcal{F}$,
- e.g., $\mathcal{O}(n)$, or Decision stump
-->
<!--
Let $\mathcal{C}= \lbrace \mathcal{P}, \mathcal{H}, \mathcal{F} \rbrace$.
-->
<!-- Let $\mathcal{S} = \lbrace \mathcal{Z}, \mathcal{Q}, \mathcal{A}, \mathcal{P}, \mathcal{H}, \mathcal{F} \rbrace$. -->
<!-- --- -->
<!-- ## Constraints -->
<!-- $\mathcal{P}$, $\mathcal{H}$, and $\mathcal{F}$ are sets of constraints on learning -->
<!--
| Constraint | Example |
| :--- | :---
| interpretability | hyperplanes or sparse
| complexity | $\mathcal{O}(n)$
| memory | $< 1$ gigabyte of memory for a given dataset
| time | $< 1$ sec on a specific hardware configuration for a given dataset
| scalability| must operate on distributed storage/compute
| power | $< 1$ watt on a given system for a given dataset
| price | $< 1$ USD on a given system for a given dataset
| hardware | must run on iPhone X
-->
---
## What is Performance?
- .ye[Loss] quantifies the error of a specific action $a$ taken by $h$ for a query $q$, $\mathcal{L} = \lbrace \ell: \mathcal{A} \times \mathcal{A} \to \mathbb{R} \rbrace$,
- e.g., 0-1 loss: $ \ell(a, a') := \mathbb{I}[a \neq a']. $
<!-- $\mathsf{l}, \mathsf{R}, \mathsf{E}, \mathsf{h}, l, R, E, h$ -->
--
- .ye[Risk] quantifies the loss over the whole query sample space, $\mathcal{R} = \lbrace R : \mathcal{H} \times \mathcal{L} \times \mathcal{P}\_{Q, A} \to \mathbb{R} \rbrace$
- We think of this only as a function of $h \in \mathcal{H}$, because the loss and distribution effectively index the function
- eg, expected loss $ R(h) := R(h; \ell, P\_{Q, A}) = \ \mathbb{E}\_{Q, A}[\ell(h(Q), A)]. $
---
## What is Performance?
- Performance, also called generalization .ye[error], quantifies risk over the distribution of possible training datasets, $\mathcal{E} : \mathcal{F} \times \mathcal{R} \times \mathcal{P}\_{z} \to \mathbb{R}$,
- We think of this only as a function of $f\_n \in \mathcal{F}$, for the same reason as above
- e.g., expected risk:
$ \mathcal{E}(f\_n) := \mathcal{E}(f\_n; R, P\_Z) = \mathbb{E}\_Z[R(f\_n(Z))]. $
<!-- TODO@ronak i put a \cdot in there. ok? -->
---
## Has $f$ Learned?
Given $n$ new data points in setting $\mathcal{S}$, assuming $P$,
$f$ learns when its performance $\mathcal{E}$ improves due to the data:
.center[$f$ learns when $\mathcal{E}(f_n) < \mathcal{E}(f_0)$.]
$\mathcal{E}(f_0)$ is the performance of $f$ prior to seeing $n$ new data points, and therefore a function of
- prior on $\theta$
- inductive bias of $\mathcal{H}$
- estimation bias of $f$
- model bias of $\mathcal{P}$
- pre-training
<!--
## What is a Setting?
A setting is defined by a septuple $\mathcal{S} = \lbrace \mathcal{Z}, \mathcal{A}, \mathcal{L}, \mathcal{R}, \mathcal{P}, \mathcal{H}, \mathcal{F} \rbrace$
| Object | Notation | Example
|:--- |:--- |:--- |
| Measurements | $ \mathcal{Z}^n$ | $\mathbb{R}^p \times \lbrace 0, 1 \rbrace$ |
| Actions | $\mathcal{A}$ | {↑,↓,←, →,B,A,start}
| Loss | $\mathcal{L}: \mathcal{A} \to \mathbb{R}_+$ | $ (\hat{y} - y_*)^2$
| Risk | $\mathcal{R}: \mathcal{P} \times \mathcal{L} \to \mathbb{R}_+$ | $\mathbb{E}_P[ \mathcal{L}(a)]$
| Distributions | $\mathcal{P} := \lbrace P_Z \rbrace$ | Gaussian
| Hypotheses | $\mathcal{H} = \lbrace h: \mathcal{Z} \to \mathcal{A} \rbrace$ | hyperplanes
| Algorithms | $\mathcal{F} = \lbrace f : 2^{\mathcal{Z}^n} \to \mathcal{H} \rbrace$ | *RandomForest.fit*
-->
---
## What is a Learning Task?
- Given
- a sample size $n$
- a setting $\mathcal{S}$
- Assume a true but unknown distribution $P \in \, \mathcal{P}$
- Find $f$ that minimizes generalization error
$$f^* = \arg \min\_{f} \, \mathcal{E}\_P(f_n).$$
---
## What is Transfer Learning?
- Let
- $t_i \in \lbrace 0, 1 \rbrace$ label each sample, where $0$ denotes .ye[source] and $1$ denotes .ye[target]
- $\mathcal{Z}' = (\mathcal{Z},\lbrace 0,1 \rbrace)$
- Assume $(Z\_i,T\_i)$ is sampled iid from $P\_{Z,T}$, $Z\_i | T\_i=j \sim P\_t$,
- Let $P = P_{Z,T} \otimes P_Q \in \, \mathcal{P}'$
- Define a transfer learning algorithm $f$ as a sequence
$$ \mathcal{F}_{TL} = \lbrace f_n : (\mathcal{Z} \times \color{yellow}{\lbrace 0,1 \rbrace })^n \rightarrow \mathcal{H} \rbrace$$
- Let $f^t$ denote the learner that only sees samples where $t_i=t$.
- Identify the appropriate performance function.
---
## Has $f$ Transfer Learned?
Given $n$ source target data points in transfer learning setting $\mathcal{S}\_{TL}$, assuming $P$,
$f$ .ye[transfer] learns when its performance $\mathcal{E}$ improves due to the source data:
.center[$f$ learns when $\mathcal{E}(f_n) < \, \mathcal{E}(f_n^1)$.]
---
## A Transfer Learning Task?
- Given
- a sample size $n$
- a transfer learning setting $\mathcal{S} := \mathcal{S}\_{TL} = ( \mathcal{Z}', \mathcal{A}, \mathcal{Q}, \mathcal{C} )$
- Assume a true but unknown distribution $P \in \, \mathcal{P}'$
- Find $f$ that minimizes generalization error
$$f^* = \arg \min\_{f} \, \mathcal{E}\_P(f_n).$$
---
## What is Multitask Learning?
- Let
- $t_i \in \color{yellow}{[T]}$ denote the task associated with sample $i$
- $\mathcal{Z}' = (\mathcal{Z}, [T])$
- Assume $(Z\_i,T\_i)$ is sampled iid from $P\_{Z,T}$, $Z\_i | T\_i=t \sim P\_t$,
- Let $P = P_{Z,T} \otimes P_Q \in \, \mathcal{P}'$
- Define a multi-task learning algorithm $f$ as a sequence
$$ \mathcal{F}_{MT} = \lbrace f_n : (\mathcal{Z} \times \color{yellow}{[T]} )^n \rightarrow \mathcal{H} \rbrace$$
- Let $f^t$ denote the learner that only sees samples where $t_i=t$.
- Identify the appropriate performance functions $\color{yellow}{\lbrace \mathcal{E}_t \rbrace}$.
---
## Has $f$ Multitask Learned?
Given $n$ data points in multitask learning setting $\mathcal{S}\_{MT}$, assuming $P$,
$f$ .ye[weakly multitask] learns when its performances $\lbrace \mathcal{E}_t \rbrace$ improve due to other task's data .ye[on average]:
$$ \sum\_{t \in [T]} \mathcal{E}\_t(f\_n ) P(t) < \sum\_{t \in [T]} \mathcal{E}\_t(f\_n^t) P(t),$$
<br>
$f$ .ye[strongly multitask] learns when its performances $\lbrace \mathcal{E}_t \rbrace$ improve due to other task's data .ye[for each task]:
$$ \mathcal{E}\_t(f_n) < \, \mathcal{E}\_t(f_n^t) \quad \forall t \in [T].$$
---
## What is Sequential Learning?
- When:
- the data arrive sequentially, potentially in batches of size $m$
- the constraints demand a fixed capacity
- there is potential for additional, $\Xi$-valued side information
- Then, a sequential learning algorithm updates existing hypotheses on the basis of new data, that is,
$$\mathcal{F}_S = \lbrace f : \color{yellow}{\mathcal{H}} \times {\mathcal{Z}^m} \times \Xi \rightarrow \mathcal{H} \rbrace$$
---
## A Sequential Learning Task?
- Given
- a number of rounds $n$
- a sequential learning setting $( \mathcal{Z}, \mathcal{A}, \mathcal{Q}, \mathcal{C})$, where $\mathcal{C}$ includes that $f_n \in \mathcal{O}(1) \, \forall n$
- Assume a true but unknown distribution $P\_i \in \, \mathcal{P}$ that nature selects at each round $i$ (can be the same).
- Assume (potentially) a pool of side information, $\Xi$.
- Find $f$ that minimizes a generalization error that is indexed by $n$
$$f^* = \arg \min\_{f} \, \mathcal{E}(f, n).$$
---
## Two Special Cases
Online Learning (OL) and Reinforcement Learning (RL) are two special cases of sequential learning, in which:
--
- The distribution of data $P\_i$ can change at each round $i$, perhaps adversarially.
--
- Some side information $\Xi$ is required to learn, either in the form of:
- $k$ experts, as in OL, or
- the existence of some state transition matrix $[P\_{s, s' \mid a}]$ for each action $a \in \mathcal{A}$, as in RL.
---
## What is Online Learning?
- Let
- data arrive sequentially in $T$ rounds
- we also observe the prediction of $k$ experts, collectively in $\Xi$
- Assume .ye[nothing], $Q\_i \sim P_i \in \mathcal{P}$, distribution could be i.i.d., conditionally dependent, or adversarial
- Define aclass of .ye[online] learning algorithms $f$ as a maps
$$ \mathcal{F}_{O} = \lbrace f : \mathcal{H} \times \color{yellow}{\Xi} \rightarrow \mathcal{H} \rbrace$$
---
## An Online Learning Task?
- Given
- a online learning setting $( \mathcal{Z}, \mathcal{A}, \mathcal{Q}, \mathcal{C})$, where $\mathcal{C}$ includes that $f \in \mathcal{O}(1) \, \forall n$
- a risk $R\_i$ at each round $i$
- expert advice $\xi\_i$ at each round $i$
- Find $f$ that minimizes .ye[regret]
$$f^* = \arg \min\_{f} \, \mathcal{E}(f, n) = \sum\_{i=1}^n R\_i(f(h\_{i-1}, \xi\_i)) - \min\_{h \in \mathcal{H}} \sum\_{i=1}^n R\_i(h).$$
---
### What is Reinforcement Learning?
- Let
- data (states) arrive sequentially in $n$ rounds
- $\mathcal{Z}\_i$ be the space of past states and actions at round $i$
- Assume upon taking action $a$, state distribution changes according to some transition matrix transition matrix $[P\_{s, s' \mid a}]$ (for finite $\mathcal{Q}$ and $\mathcal{A}$).
- Let $\mathcal{H}$ be the space of policies (hypotheses)
- Define a .ye[reinforcment] learning algorithms $f$ as a sequence
$$ \mathcal{F}_{R} = \lbrace f\_i : \color{yellow}{\mathcal{Z}_i} \rightarrow \mathcal{H} \rbrace$$
---
### A Reinforcement Learning Task?
- Given
- reinforcement learning settings $( \mathcal{Z}\_i, \mathcal{A}, \mathcal{Q}, \mathcal{C})\_i$, where
- $\mathcal{Q}$ and $\mathcal{A}$ are the state and action spaces, respectively,
- $\mathcal{Z}\_i = (\mathcal{Q} \times \mathcal{A})^{i-1}$ is the space of past state-action pairs
- a discount rate $\gamma$
- a reward function $\bar{R}$
- Find $f$ that maximizes .ye[expected reward]
$$ f^* = \arg \min\_{f} \, \mathcal{E}(f, n) = -\mathbb{E}\big[ \sum\_{i=0}^n \gamma^{n-i} \bar{R}(Q\_i, f(Z\_i))\big] $$
---
## What is a Lifelong Task?
Sequential multi-task learning, where
- $|\mathcal{T}|$ is a (countably) infinite set of tasks
- $T_n$ is the number of tasks observed after $n$ samples
- $n_t$ is the number of samples for task $t$
- Requires .ye[out of task] capabilities
---
## What is a Lifelong Task?
- Let
- $t_i \in \color{yellow}{\mathcal{T}}$ denote the task associated with sample $i$
- $\mathcal{Z}' = (\mathcal{Z}, \mathcal{T})$
- Assume $(Z\_i,T\_i)$ is sampled iid from $P\_{Z,T}$, $Z\_i | T\_i=t \sim P\_t$,
- Let $P = P_{Z,T} \otimes P_Q \in \, \mathcal{P}'$
- Define a lifelong learning algorithm $f=f_1, f_2, \ldots$ as a sequence
$$ \mathcal{F}_{L2} = \lbrace f_n : \mathcal{H} \times (\mathcal{Z} \times \color{yellow}{\mathcal{T}} )^n \rightarrow \mathcal{H} \rbrace$$
- Let $f^t$ denote the learner that only sees samples where $t_i=t$.
- Identify the appropriate performance functions $\lbrace \mathcal{E}_t \rbrace$.
---
## What is Lifelong Learning?
Given $n$ data points sequentially in lifelong learning setting $\mathcal{S}\_{L2}$, assuming $P$,
$f$ .ye[weakly lifelong] learns when its performances $\lbrace \mathcal{E}_t \rbrace$ improve due to other task's data .ye[on average]:
<!-- $$ \mathbb{E} \Big[ \sum\_{t \in [T\_n]} \mathcal{E}\_t(f\_n ) \Big] <
\mathbb{E} \sum\_{t \in [T\_n]} \mathcal{E}\_t(f\_n^t),$$ -->
$$ \sum\_{t \in [T\_n]} n\_t \mathcal{E}\_t(f\_n ) <
\sum\_{t \in [T\_n]} n\_t \mathcal{E}\_t(f\_n^t) ,$$
<!-- $$ \sum\_{i \in [n]} \mathcal{E}\_{t\_i}(f\_i )
<
\sum\_{i \in [n]} \mathcal{E}\_{t\_i}(f\_i^{t_i}),$$ -->
<br>
$f$ .ye[strongly lifelong] learns when its performances $\lbrace \mathcal{E}_t \rbrace$ improve due to other task's data .ye[for each task]:
$$ \mathcal{E}\_t(f_n) < \, \mathcal{E}\_t(f_n^t) \quad \forall t \in [T\_n].$$
---
name:scenarios
## Outline
- [Summary](#summary)
- [Definition](#def)
- Scenarios
- [Metrics](#metrics)
- [Algorithm](#alg)
- [Simulations](#sims)
- [Real](#real)
- [Theory](#theory)
- [Neurobiology](#neuro)
- [Discussion](#disc)
---
## Lifelong Learning Taxonomy
![:scale 100%](images/learning-taxonomy.svg)
---
## Ways Tasks can Differ
| Component | Notation | Examples |
| :--- | :--- | :---
| Sample Space | $\mathcal{Z}$ | another modality
| Action Space | $\mathcal{A}$ | class incremental, task incremental
| Query Space | $\mathcal{Q}$ | new queries allowed
| Constraints | $\mathcal{C}$ | added hardware
| Performance | $\mathcal{E}$ | $L_2 \to L_1$
| Distribution | $P$ | Gaussian to Log-Gaussian
| Task Awareness | $T_i$ | {aware, oblivious, semi-aware}
$2^6 \times 3 \approx 200$ ways tasks can differ.
---
## Assumptions on Nature
The curriculum decided by nature can be:
- task constant
- task semi-constant
- task non-constant
- typically requires restrictions on amount of data per task, or side information (OL, RL, LL)
<!-- TODO@JV maybe move below slides to real data -->
---
## Vision Task 1
.pull-left[
- *CIFAR 100* is a popular image classification dataset with 100 classes of images.
- 500 training images and 100 testing images per class.
- All images are 32x32 color images.
- CIFAR 10x10 breaks the 100-class task problem into 10 tasks, each with 10-class.
]
.pull-right[
<img src="images/l2m_18mo/cifar-10.png" style="position:absolute; left:450px; width:400px;"/>
]
<br>
--
Why its a good scenario:
1. current reference dataset
2. a variant of this is "Class Incremental", where each subsequent task includes all previous tasks, which is harder
---
## Vision Task 2
- EfficientNet used we different image datasets
- Each has different number of classes, samples
- Even within dataset, each image could be different size and aspect ratio
- Sequentially train on each dataset
![:scale 50%](images/12-datasets.png)
Why it is a good scenario:
1. Images are more real (different resolutions, scales, # classes)
2. Many metrics (localization, fine grained objects, texture, scene)
3. Benchmark results are available
---
## Language Task 1
- 8,194,317 sentences from wikipedia (downloaded from facebook).
- 156 languages
- Trained using unsupervised FastText embedding
- words, 2-4 char n-grams embedded into 16 dimensions
- selected 30 languages
- break into batches of 3 "related" languages
![:scale 50%](images/30-languages.png)
Why it is a good scenario:
1. Public and real data
2. Not vision
---
## Language Task 2
.pull-left[
- same feature vectors as above
- labels now correspond to Microsoft Bing "dominant type"
- 10k training and 1k testing entities
- 20 classes (each with at least 11k samples)
- 4 classes per task
Why is this a good scenario:
1. Public data
2. Real application
]
.pull-right[
![:scale 100%](images/bing-dominant-types.png)
]
<!--
## Examples
1. Task 2: $P$ and $\mathcal{A}$ are different,
- this is "Task Incremental Learning" (CIFAR 10x10)
1. Task 2: $P$ changes and $\mathcal{A}$ gets bigger,
- this is "Class Incremental Learning"
1. Task 2: $P$ changes, but $f$ does not know (continual learning)
-->
---
name:metrics
## Outline
- [Summary](#summary)
- [Definition](#def)
- [Scenarios](#scenarios)
- Metrics
- [Algorithm](#alg)
- [Simulations](#sims)
- [Real](#real)
- [Theory](#theory)
- [Neurobiology](#neuro)
- [Discussion](#disc)
---
## Transfer Efficiency (TE)
The transfer efficiency of learning algorithm $f$ for task $t$ is
$$ TE\_t(f) :=
\frac{\mathcal{E}\_t(f^t_n)}{\mathcal{E}\_t(f_n)}.
$$
<br>
Algorithm $ f $ transfer learns if $ TE_t(f) > 1 $.
---
## Forward / Backward TE
- Let $f^{t_-}_n$ denote the algorithm with all access up to the last sample associated with task $t$.
<!-- - Let $\mathcal{D}_F^t = \{(X_i, Y_i, T_i) \in \, \mathcal{D} : i \leq n_t\}$ be the set of all data up to sample $n_t$. -->
- .ye[Forward] transfer efficiency of $ f $ for task $t$ is the improvement on task $t$ resulting from all data .ye[preceding] task $t$
$$ FTE\_t(f) :=
\frac{\mathcal{E}\_t(f^t\_n)}{\mathcal{E}\_t(f^{t\_-}\_n)}.
$$
--
<!-- ## Backward Transfer Efficiency -->
<!-- Backward Transfer Efficiency (BTE) for task $t$ measures the improvement on task $t$ resulting from all data occurring after the last sample $i$ with $T_i = j$. -->
- .ye[Backward] transfer efficiency of $ f $ for task $t$ is the improvement on task $t$ resulting from all data .ye[after] task $t$
<!-- The backward transfer efficiency of $ f $ for task $t$ is -->
$$ BTE\_t(f) :=
\frac{\mathcal{E}\_t(f^{t\_-}_n)}{\mathcal{E}_t(f_n)}.
$$
---
## TE Factorizes
$$ TE\_t(f) :=
\frac{\mathcal{E}\_t(f^t\_n)}{\mathcal{E}\_t(f\_n)}
= \frac{\mathcal{E}\_t(f^t\_n)}{\mathcal{E}\_t(f^{t\_-}\_n)}
\times
\frac{\mathcal{E}\_t(f^{t\_-}\_n)}{\mathcal{E}\_t(f\_n)}.
$$
---
name:alg
## Outline
- [Summary](#summary)
- [Definition](#def)
- [Scenarios](#scenarios)
- [Metrics](#metrics)
- Algorithm
- [Simulations](#sims)
- [Real](#real)
- [Theory](#theory)
- [Neurobiology](#neuro)
- [Discussion](#disc)
---
## Basic Idea
For each new task,
1. learn a new representation function,
2. apply it to all data from all tasks: the updated representation for everything is the composition of this new representation with existing representations.
4. update all decision rules using this representation.
Notes:
- This linearly increases representation capacity.
- Without increasing representation capacity, performance on all tasks will necessarily drop to chance levels eventually as number of tasks increases.
- Thus, fixed capacity systems can only lifelong learn insofar as they are inefficient (unnecessarily big) for individual tasks.
---
## Composable Hypotheses
.center[ .ye[$h(\cdot) := w \circ v \circ u (\cdot) = w(v(u(\cdot)))$]]
- Let $u$ be .ye[transformer] data to a new representation,
$$ u : \mathcal{X} \to \tilde{\mathcal{X}}$$
- Let $v$ be .ye[voter] which operate on the transformed data outputs votes on all possible actions
$$ v : \tilde{\mathcal{X}} \to \mathcal{P}_{A|X}$$
- Let $w$ be .ye[decider] which decides which actions to take on the basis of the votes
$$ w : \mathcal{P}_{A|X} \to \mathcal{A}$$
---
## Simple Examples
- Linear Discriminant Analysis (shallow)
- $u$: projection onto a line
- $v$: fraction of points per over/under threshold
- $w$: maximum a posteriori class