1
00:00:12,050 --> 00:00:18,310
In this lecture we are going to do image classification using an R N N on the M9 dataset.

2
00:00:18,350 --> 00:00:23,450
This lecture is going to walk you through a prepared code lab notebook although a very good exercise

3
00:00:23,480 --> 00:00:29,480
which I always recommend is once you know how this is done to try and recreate it yourself with as few

4
00:00:29,480 --> 00:00:31,280
references as possible.

5
00:00:31,430 --> 00:00:36,590
As usual you can look at the title of the notebook to determine what notebook we are currently looking

6
00:00:36,590 --> 00:00:36,880
at.

7
00:00:37,970 --> 00:00:39,830
At the top we have all our imports.

8
00:00:39,860 --> 00:00:43,360
Nothing new for you here.

9
00:00:43,360 --> 00:00:45,250
Next we load in the data.

10
00:00:45,250 --> 00:00:49,090
Note that this is exactly the same way we loaded in the data previously.

11
00:00:49,120 --> 00:00:51,430
So nothing here needs to change.

12
00:00:51,430 --> 00:00:58,660
Recall that this data has the shape end by 28 by twenty eight.

13
00:00:59,010 --> 00:01:01,110
Next we build our model.

14
00:01:01,110 --> 00:01:05,120
Luckily due to my rule all machine learning interfaces are the same.

15
00:01:05,130 --> 00:01:13,390
This is the exact same LSD model we worked with previously.

16
00:01:13,410 --> 00:01:21,250
Next we instantiate the model and we set the device and move the model to the GP you next.

17
00:01:21,330 --> 00:01:28,160
We set the loss and optimizer and as you can see I'm using the default atom optimizer here.

18
00:01:28,230 --> 00:01:33,850
It seemed to work fine for this architecture and this dataset.

19
00:01:33,990 --> 00:01:35,220
Next we train the model

20
00:01:40,540 --> 00:01:41,010
all right.

21
00:01:41,020 --> 00:01:43,710
So the last per iteration looks pretty good

22
00:01:46,850 --> 00:01:52,400
next we compute the accuracy.

23
00:01:52,540 --> 00:01:52,920
All right.

24
00:01:52,940 --> 00:01:58,220
So we can see from the results that we get about ninety nine percent accuracy on both the train and

25
00:01:58,220 --> 00:02:00,850
test sets after just ten epochs.

26
00:02:01,010 --> 00:02:06,380
The neural network appears to generalize well and it doesn't have a problem capturing long distance

27
00:02:06,380 --> 00:02:08,580
information in the image.

28
00:02:08,690 --> 00:02:14,960
I would consider this to be long distance because you can't know what digit the images of unless you

29
00:02:14,990 --> 00:02:16,610
consider the image as a whole.

30
00:02:17,120 --> 00:02:22,850
You can't just look at say the last five rows of the image to determine what the images of most likely

31
00:02:23,180 --> 00:02:29,330
the last five rows are just all black pixels anyway since the digit in the image is centered the length

32
00:02:29,330 --> 00:02:35,270
of the sequence is 28 which is pretty long in comparison so it's quite surprising that the Ellis yeah

33
00:02:35,360 --> 00:02:39,590
is able to learn to classify handwritten digits so efficiently.

34
00:02:39,590 --> 00:02:40,560
And there you have it.

35
00:02:40,610 --> 00:02:43,690
Yet another lesson in my motto all data is the same.
