-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCS 285 Lecture 1, Part 2.srt
1586 lines (1194 loc) · 26.4 KB
/
CS 285 Lecture 1, Part 2.srt
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
1
00:00:01,199 --> 00:00:06,580
So, why should we care about deep reinforcement learning?
In particular deep is in the title of this class
2
00:00:06,720 --> 00:00:09,220
So, let's talk about that a little bit.
3
00:00:10,000 --> 00:00:12,900
And to start this conversation,
we'll start with a really big question.
4
00:00:13,000 --> 00:00:18,100
and this is a question that we'll come back
to a few times in the first lecture module.
5
00:00:18,240 --> 00:00:24,320
How do we build intelligent machines?
6
00:00:21,840 --> 00:00:26,880
and by this, i really mean literally
what it says on at the top
7
00:00:24,880 --> 00:00:32,719
intelligent machines the kind of machines that we see in cartoons
8
00:00:28,960 --> 00:00:34,320
are robot butlers robot helpers that
9
00:00:32,719 --> 00:00:36,880
help with medical care
10
00:00:34,320 --> 00:00:38,079
or even science fiction robots that
11
00:00:36,880 --> 00:00:39,760
pilot starships
12
00:00:38,079 --> 00:00:41,120
or if you're a little bit more
13
00:00:39,760 --> 00:00:44,559
mischievously inclined
14
00:00:41,120 --> 00:00:46,079
evil robot villains.
15
00:00:44,559 --> 00:00:48,079
Intelligent machines have to be able to
16
00:00:46,079 --> 00:00:49,760
adapt they have to handle
17
00:00:48,079 --> 00:00:52,079
flexibly the complexity and
18
00:00:49,760 --> 00:00:54,000
unpredictability of the real world.
19
00:00:52,079 --> 00:00:56,079
If we wanted to build for instance an
20
00:00:54,000 --> 00:00:57,440
autonomous oil tanker
21
00:00:56,079 --> 00:00:59,920
that would not be very difficult to do
today.
22
00:00:57,440 --> 00:01:00,559
While it's hard for humans to
23
00:00:59,920 --> 00:01:02,320
figure out
24
00:01:00,559 --> 00:01:04,239
how to navigate the ocean to reach a
25
00:01:02,320 --> 00:01:06,640
destination half a world away
26
00:01:04,239 --> 00:01:07,760
a combination of gps and motion planning
27
00:01:06,640 --> 00:01:09,360
can actually solve this problem
28
00:01:07,760 --> 00:01:11,439
reasonably well.
29
00:01:09,360 --> 00:01:12,799
However, most oil tankers still have
30
00:01:11,439 --> 00:01:14,479
human crews on board.
31
00:01:12,799 --> 00:01:15,680
Why is that? Well, it's because when
32
00:01:14,479 --> 00:01:17,040
something goes wrong when something
33
00:01:15,680 --> 00:01:18,320
breaks in the engine room,
34
00:01:17,040 --> 00:01:20,159
you really need a person to go down
35
00:01:18,320 --> 00:01:21,280
there and fix it.
36
00:01:20,159 --> 00:01:23,040
While navigating the oil tanker
37
00:01:21,280 --> 00:01:25,200
is comparatively not a very difficult
38
00:01:23,040 --> 00:01:27,520
artificial intelligence problem.
39
00:01:25,200 --> 00:01:29,280
Fixing something when it goes wrong with
40
00:01:27,520 --> 00:01:31,680
current technology is exceedingly difficult
41
00:01:32,159 --> 00:01:35,360
The difficulty really comes from the
42
00:01:33,520 --> 00:01:36,479
fact the real world is unstructured and
43
00:01:35,360 --> 00:01:38,400
unpredictable.
44
00:01:36,479 --> 00:01:40,079
And a very powerful technology for
45
00:01:38,400 --> 00:01:41,759
handling the unstructured unpredictable
46
00:01:40,079 --> 00:01:44,240
nature of the real world that we have at
47
00:01:41,759 --> 00:01:47,280
our disposal is deep learning.
48
00:01:44,240 --> 00:01:49,119
In deep learning, we train a very large
49
00:01:47,280 --> 00:01:51,040
heavily over parametrized model like a
50
00:01:49,119 --> 00:01:54,079
deep neural network to map inputs to outputs.
51
00:01:52,000 --> 00:01:55,119
For instance, if you want to recognize
52
00:01:54,079 --> 00:01:56,799
objects in an image
53
00:01:55,119 --> 00:01:58,479
you would collect a large number of
54
00:01:56,799 --> 00:02:00,320
labeled images and then
55
00:01:58,479 --> 00:02:01,840
use typically standard supervised
56
00:02:00,320 --> 00:02:04,560
learning methods to predict inputs from outputs.
57
00:02:02,719 --> 00:02:06,240
But deep learning is fundamentally about
58
00:02:04,560 --> 00:02:08,239
the choice of large over-parameterized models
59
00:02:06,880 --> 00:02:10,319
more than it is about the choice of the algorithm.
60
00:02:08,239 --> 00:02:11,440
We've seen deep learning methods
61
00:02:10,319 --> 00:02:15,360
succeed at tasks ranging from
62
00:02:12,720 --> 00:02:17,440
image classification to translating text
63
00:02:15,360 --> 00:02:20,480
even directly from images to recognizing human speech.
64
00:02:18,480 --> 00:02:21,840
And these are all open world settings in
65
00:02:20,480 --> 00:02:23,040
the sense that
66
00:02:21,840 --> 00:02:24,720
you need models that generalize
67
00:02:23,040 --> 00:02:28,080
effectively to things they've never seen before
68
00:02:25,599 --> 00:02:31,599
and all sorts of weird special cases and
69
00:02:28,080 --> 00:02:31,599
unusual situations can arise.
70
00:02:31,920 --> 00:02:34,800
Reinforcement learning provides a
71
00:02:33,200 --> 00:02:36,480
formalism for behavior as i mentioned
72
00:02:34,800 --> 00:02:38,239
before it provides a mathematical
73
00:02:36,480 --> 00:02:41,680
way of thinking about sequential decision-making.
74
00:02:39,680 --> 00:02:44,239
In reinforcement learning,
an agent interacts with the world,
75
00:02:41,680 --> 00:02:46,400
gets observations and rewards
76
00:02:44,239 --> 00:02:48,000
and these kinds of methods have been
77
00:02:46,400 --> 00:02:51,120
used in combination
78
00:02:48,000 --> 00:02:51,440
with deep neural networks for a variety
79
00:02:51,120 --> 00:02:53,280
of
80
00:02:51,440 --> 00:02:54,560
applications where you do have to handle
81
00:02:53,280 --> 00:02:56,800
flexibly
82
00:02:54,560 --> 00:02:58,640
unusual and unpredictable situations.
83
00:02:56,800 --> 00:03:00,159
For instance, one of the early successes
84
00:02:58,640 --> 00:03:02,000
of the combination of reinforcement
85
00:03:00,159 --> 00:03:03,120
learning and neural networks has been
86
00:03:02,000 --> 00:03:06,080
learning to play
87
00:03:03,120 --> 00:03:07,519
the board game of backgammon.
88
00:03:06,080 --> 00:03:08,959
This is a system called td gammon
89
00:03:07,519 --> 00:03:10,800
that learned to play backgammon at the
90
00:03:08,959 --> 00:03:11,760
level of an expert human.
91
00:03:10,800 --> 00:03:13,760
Not quite at the level of beating
92
00:03:11,760 --> 00:03:15,680
the championed human player but a very
93
00:03:13,760 --> 00:03:18,080
at a very professional level.
94
00:03:15,680 --> 00:03:21,360
The technology behind alphago which
95
00:03:18,080 --> 00:03:23,440
defeated the human champion for go 2016
96
00:03:21,360 --> 00:03:26,000
in many ways had a lot in common with
97
00:03:23,440 --> 00:03:27,360
td gammon back in the 90s.
98
00:03:26,000 --> 00:03:28,720
Deep reinforcement learning methods
99
00:03:27,360 --> 00:03:31,280
meaning reinforcement learning algorithms
100
00:03:29,360 --> 00:03:33,040
that use deep neural networks have been
101
00:03:31,280 --> 00:03:34,879
used for tasks ranging from
102
00:03:33,040 --> 00:03:36,080
robotic locomotion to robotic
103
00:03:34,879 --> 00:03:39,280
manipulation skills
104
00:03:36,080 --> 00:03:42,319
playing video games and so on.
105
00:03:39,280 --> 00:03:44,000
So what is deep RL exactly?
106
00:03:42,319 --> 00:03:46,319
And why should we care about it?
107
00:03:44,000 --> 00:03:47,920
Well, to understand the importance of
108
00:03:46,319 --> 00:03:49,040
deep RL the difference that it makes in
109
00:03:47,920 --> 00:03:51,519
reinforcement learning methods
110
00:03:49,040 --> 00:03:52,799
Let's start with
111
00:03:51,519 --> 00:03:54,400
an example from a different domain an
112
00:03:52,799 --> 00:03:56,959
example from computer vision
113
00:03:54,400 --> 00:03:57,599
to see why it is that deep neural
114
00:03:56,959 --> 00:03:59,200
networks
115
00:03:57,599 --> 00:04:01,920
have such a transformative effect on the
116
00:03:59,200 --> 00:04:04,000
capabilities of machine learning systems.
117
00:04:01,920 --> 00:04:05,040
So if we go back in time maybe about
118
00:04:04,000 --> 00:04:06,159
15 to 20 years
119
00:04:05,040 --> 00:04:07,680
and see how computer vision was
120
00:04:06,159 --> 00:04:08,720
typically done we would see something
121
00:04:07,680 --> 00:04:10,720
like this.
122
00:04:08,720 --> 00:04:12,640
You start with pixels in an image and
123
00:04:10,720 --> 00:04:14,159
then you extract some hand-designed
124
00:04:12,640 --> 00:04:16,079
low-level visual features from those
125
00:04:14,159 --> 00:04:18,000
pixels like for instance a histogram of
126
00:04:16,079 --> 00:04:20,079
oriented gradients.
127
00:04:18,000 --> 00:04:22,320
Then you might extract some mid-level features,
128
00:04:20,079 --> 00:04:25,120
like a deformable parts model,
for example,
129
00:04:23,280 --> 00:04:26,960
and then on top of those mid-level features
130
00:04:25,120 --> 00:04:28,000
you would train some simple
131
00:04:26,960 --> 00:04:29,600
linear classifier
132
00:04:28,000 --> 00:04:30,880
like a support vector machine to
133
00:04:29,600 --> 00:04:35,280
actually classify the thing that you want.
134
00:04:32,639 --> 00:04:37,600
Now with deep learning the deep neural net
135
00:04:35,840 --> 00:04:39,520
performs much the same function
136
00:04:37,600 --> 00:04:40,639
internally it has mid-level features and
137
00:04:39,520 --> 00:04:42,639
low level features
138
00:04:40,639 --> 00:04:44,000
and a classifier the difference is that
139
00:04:42,639 --> 00:04:46,800
these now don't have to be designed by hand.
140
00:04:44,479 --> 00:04:48,560
They're actually learned end-to-end by
141
00:04:46,800 --> 00:04:50,160
the deep neural network.
142
00:04:48,560 --> 00:04:52,000
This not only means that we save a lot
143
00:04:50,160 --> 00:04:52,960
of human effort in designing all those
144
00:04:52,000 --> 00:04:54,880
features.
145
00:04:52,960 --> 00:04:56,320
But it also means that the features are
146
00:04:54,880 --> 00:04:57,600
optimally adapted to the tasks that they
147
00:04:56,320 --> 00:04:58,960
actually have to solve.
148
00:04:57,600 --> 00:05:00,800
So you don't just get some generic
149
00:04:58,960 --> 00:05:01,919
histogram or ingredients features you
150
00:05:00,800 --> 00:05:06,320
get the right features
151
00:05:01,919 --> 00:05:07,680
for classifying tigers from jaguars.
152
00:05:06,320 --> 00:05:09,520
Now let's think about how this lesson
153
00:05:07,680 --> 00:05:10,120
maps on to
the reinforcement learning setting.
154
00:05:10,160 --> 00:05:13,379
Let's think about the game of backgammon.
155
00:05:13,520 --> 00:05:16,720
If you wanted to use standard
156
00:05:14,479 --> 00:05:18,160
reinforcement learning methods you would
157
00:05:16,720 --> 00:05:19,759
have to extract features from the game
158
00:05:18,160 --> 00:05:21,840
of backgammon somehow.
159
00:05:19,759 --> 00:05:23,440
What kind of features do you use?
160
00:05:21,840 --> 00:05:24,720
Well, maybe if you're an extra backgammon
161
00:05:23,440 --> 00:05:26,160
player you might know that there are
162
00:05:24,720 --> 00:05:27,759
some things that matter in the game i
163
00:05:26,160 --> 00:05:29,039
i'm not an expert backgammon player so i
164
00:05:27,759 --> 00:05:30,320
don't know what those things are but
165
00:05:29,039 --> 00:05:30,800
perhaps you know what they are and then
166
00:05:30,320 --> 00:05:33,360
you could
167
00:05:30,800 --> 00:05:33,620
write them down.
168
00:05:32,460 --> 00:05:34,700
But it's not enough to just have
169
00:05:34,320 --> 00:05:36,800
features that you think are important
170
00:05:35,600 --> 00:05:37,440
for the game they have to also be
171
00:05:36,800 --> 00:05:40,320
features
172
00:05:37,440 --> 00:05:41,840
that can be used to represent policies
173
00:05:40,320 --> 00:05:43,360
value functions and other objects
174
00:05:41,840 --> 00:05:44,400
relevant to reinforcement learning in
175
00:05:43,360 --> 00:05:47,440
some simple way
176
00:05:44,400 --> 00:05:48,800
like a tabular or linear representation.
177
00:05:47,440 --> 00:05:50,880
And that's much harder design because
178
00:05:48,800 --> 00:05:53,360
now you need someone who is not only
179
00:05:50,880 --> 00:05:55,520
an expert and backgammon but also an
180
00:05:53,360 --> 00:05:56,880
expert in reinforcement learning.
181
00:05:55,520 --> 00:05:59,039
And you need a lot of intuition for
182
00:05:56,880 --> 00:06:00,560
which features are good
183
00:05:59,039 --> 00:06:02,080
This turned out to be very difficult in
184
00:06:00,560 --> 00:06:03,039
practice and for a long time it was
185
00:06:02,080 --> 00:06:04,800
extremely hard
186
00:06:03,039 --> 00:06:07,680
to apply reinforcement learning methods
187
00:06:04,800 --> 00:06:09,360
to complex problems.
188
00:06:07,680 --> 00:06:11,600
Deep learning applies the same formula
189
00:06:09,360 --> 00:06:13,360
to reinforcement learning that it did
190
00:06:11,600 --> 00:06:14,720
to the computer mission problem which is
191
00:06:13,360 --> 00:06:15,520
that we replace the manual feature
192
00:06:14,720 --> 00:06:17,199
extraction
193
00:06:15,520 --> 00:06:18,880
with automatically learned features
194
00:06:17,199 --> 00:06:21,440
represented by a deep neural network
195
00:06:18,880 --> 00:06:23,199
and train it end to end.
196
00:06:21,440 --> 00:06:24,479
However in the reinforcement learning setting
197
00:06:23,199 --> 00:06:26,160
typically for the breadth of problems
198
00:06:24,479 --> 00:06:27,360
that we want to handle our intuition for
199
00:06:26,160 --> 00:06:29,039
designing features
200
00:06:27,360 --> 00:06:33,280
is substantially weaker than it is for
computer vision
201
00:06:30,960 --> 00:06:34,319
and for this reason,
deep reinforcement learning methods have
202
00:06:33,280 --> 00:06:35,919
a transformative effect on the
203
00:06:34,319 --> 00:06:38,319
capabilities of reinforcement learning
algorithms.
204
00:06:39,200 --> 00:06:46,400
So what does end-to-end learning mean
for sequential decision making?
205
00:06:43,600 --> 00:06:49,199
Well, first let me explain what it means
206
00:06:46,400 --> 00:06:50,319
to not have intended learning.
207
00:06:49,199 --> 00:06:51,680
When you don't have intended learning
208
00:06:50,319 --> 00:06:53,039
that means that you have to handle the
209
00:06:51,680 --> 00:06:54,880
recognition part of the problem and the
210
00:06:53,039 --> 00:06:57,440
control part of the problem separately.
211
00:06:54,880 --> 00:06:58,560
So maybe you have one system that
212
00:06:57,440 --> 00:07:00,560
figures out what you're seeing in an
213
00:06:58,560 --> 00:07:02,720
image are you seeing a tiger or jaguar
214
00:07:00,560 --> 00:07:04,400
or something innocuous and then a
215
00:07:02,720 --> 00:07:06,160
pipeline that leads to another component
216
00:07:04,400 --> 00:07:09,360
that decides what actually to take based
217
00:07:06,160 --> 00:07:09,360
on that perceptual outcome.
218
00:07:09,520 --> 00:07:12,639
And you train your perception system to
219
00:07:11,360 --> 00:07:13,440
be a good perception system and
220
00:07:12,639 --> 00:07:14,800
recognize
221
00:07:13,440 --> 00:07:16,479
what you're seeing accurately and you
222
00:07:14,800 --> 00:07:18,400
train your control system to be a good
223
00:07:16,479 --> 00:07:19,759
control system to take the right actions.
224
00:07:18,400 --> 00:07:21,680
But because the perception system is
225
00:07:19,759 --> 00:07:22,560
trained separately it's not informed by
226
00:07:21,680 --> 00:07:24,800
the demands
227
00:07:22,560 --> 00:07:26,000
of the behavioral system it doesn't know
228
00:07:24,800 --> 00:07:27,120
what kind of detections are important,
229
00:07:26,000 --> 00:07:29,599
what kind are not important,
230
00:07:27,120 --> 00:07:30,960
what kind of mistakes are costly
231
00:07:29,599 --> 00:07:32,560
and what kind of mistakes are less costly.
232
00:07:30,960 --> 00:07:35,680
And that's a big deal we
233
00:07:32,560 --> 00:07:35,680
need to run away from the tiger.
234
00:07:35,759 --> 00:07:38,720
An intense system closes the sensory
235
00:07:37,680 --> 00:07:40,240
motor loop but actually trains the
236
00:07:38,720 --> 00:07:42,400
entire system end-to-end
237
00:07:40,240 --> 00:07:43,759
performing both perception and control
238
00:07:42,400 --> 00:07:46,319
acquiring both visual
239
00:07:43,759 --> 00:07:48,000
and behavioral features directly
240
00:07:46,319 --> 00:07:51,440
informed by the final performance of the task.
241
00:07:50,000 --> 00:07:53,039
Here's what that means in some example
242
00:07:51,440 --> 00:07:54,240
application scenarios if you want to do
243
00:07:53,039 --> 00:07:56,160
robotic control
244
00:07:54,240 --> 00:07:57,440
a traditional robotics pipeline will
245
00:07:56,160 --> 00:07:59,680
consist of stages
246
00:07:57,440 --> 00:08:01,759
taking in observations estimating the
247
00:07:59,680 --> 00:08:02,960
state such as the positions of objects