In this lecture we are going to do image classification using an R N N on the M9 dataset.
This lecture is going to walk you through a prepared code lab notebook although a very good exercise
which I always recommend is once you know how this is done to try and recreate it yourself with as few
references as possible.
As usual you can look at the title of the notebook to determine what notebook we are currently looking
at.
At the top we have all our imports.
Nothing new for you here.
Next we load in the data.
Note that this is exactly the same way we loaded in the data previously.
So nothing here needs to change.
Recall that this data has the shape end by 28 by twenty eight.
Next we build our model.
Luckily due to my rule all machine learning interfaces are the same.
This is the exact same LSD model we worked with previously.
Next we instantiate the model and we set the device and move the model to the GP you next.
We set the loss and optimizer and as you can see I'm using the default atom optimizer here.
It seemed to work fine for this architecture and this dataset.
Next we train the model
all right.
So the last per iteration looks pretty good
next we compute the accuracy.
All right.
So we can see from the results that we get about ninety nine percent accuracy on both the train and
test sets after just ten epochs.
The neural network appears to generalize well and it doesn't have a problem capturing long distance
information in the image.
I would consider this to be long distance because you can't know what digit the images of unless you
consider the image as a whole.
You can't just look at say the last five rows of the image to determine what the images of most likely
the last five rows are just all black pixels anyway since the digit in the image is centered the length
of the sequence is 28 which is pretty long in comparison so it's quite surprising that the Ellis yeah
is able to learn to classify handwritten digits so efficiently.
And there you have it.
Yet another lesson in my motto all data is the same.