In this lecture we are going to discuss an application of our own ends that I think would be nice because
most other resources don't cover anything like this.
In particular we are going to look at how to apply Arnolds to image classification.
Now you might think that's pretty weird.
I thought CNN is where our images and art ends were for sequences and indeed that's generally the case.
But in this lecture I hope to expand your mind a little bit.
So basically this is all about your imagination.
If you recall when we took our dumb as possible approach what did we do.
Originally we considered tabular data such as what you might collect in a survey.
Each column just represents your answers to my survey questions.
How long did you study for my math exam.
How many hours did you spend playing video games have you completed all the assignments in the course
so far and so on.
These are called features and they make up the input feature vector.
Well the dumbest possible approach for dealing with images was just to flatten the pixels of the image
and pretend that it's a feature vector.
Pretend that each pixel value is an answer to a survey question.
In other words this is all make believe you are just using your imagination.
We did the same thing with time series sequences.
Instead of thinking of it as a sequence if we just want to pass the data into an and then we just pretend
the sequence is a feature vector and that each value of the sequence is your answer to a survey question.
Again all make believe.
Stock prices are not answers to a survey question.
It's just imaginary.
So how about we think of other kinds of data using this imaginary perspective.
Here's what we know.
A multi-dimensional time series is a T by D matrix.
This is a two dimensional matrix where each column is a time series by the way.
Note that this image is a little misleading because each time series is a row.
It goes from left to right.
This is just due to the way we visualize time series.
It would look very strange if I gave you a time series that went from top to bottom.
So just keep that in mind.
A time series stored in a matrix would go along the columns because the number of rows t is the number
of timestamps
now consider a black and white image such as what we have in amnesty and fashion amnesty.
This is a height by width matrix.
Importantly it is also a two dimensional matrix.
Each I give.
Entry of the matrix is the pixel intensity at row I column J.
But here's the trick.
Since a multi-dimensional time series is a two dimensional matrix and an image is also a two dimensional
matrix.
How about we just use our imagination to pretend that an image is a multi-dimensional time series
using this method you can think of the on in as like an image scanner.
It scans each pixel of the image from top to bottom looking at each row one at a time and updating the
hidden state based on each row it encounters from here.
Our code preparation doesn't involve anything we haven't seen already
step number one is to load in the data.
That's just amnesty from this.
We get our input data as an array which is of size and bytes by DB.
Here t is 28 but this is also 28.
Step number two is to instantiate our model for this we can use an Alice VM network and have the final
dense layer with 10 outputs and a soft Max activation.
After this we call fit as usual and plot the loss in accuracy per iteration.
So very easy.
All it required was a different way of thinking about images as an exercise.
You might want to try implementing this before looking at my code to practice what you've learned so
far.
Remember this doesn't require anything new.
Just putting together old things in new ways.
As a side note you might also want to try global Max pulling as well to see if it improves performance.