In this lesson we're going to start up our Jupiter notebook and we're also going to grab the data set.
All right.
So in your project folder go to New Python 3 start up that you notebook and let's rename this thing
from C untitled to 10 neural nets hyphen carries sofar 10 classification.
Now let's hit rename and then let's insert some markdown cells that first one impulse and Let's insert
another one that shall read get the data.
Now let's find out if the tensor flow and cares installation worked properly.
However one thing I want to mention is that as part of this module there's going to be a lot of random
numbers that are going to be generated and used behind the scenes both by Caris and by tensor flow.
Now these random numbers are gonna be part of the algorithms that are going to be used.
And if you and I don't have the same starting point if you don't have the same seed for these random
numbers then we might get very different results.
So in order for this module and for this work to be reproducible and to avoid confusion if you get some
different numbers string up we should both set the same seed in the very beginning of this notebook
so we'll set from num pi dot random import seed and then we'll set this number pi seed to lucky number
like eight eight eight.
So Caris will actually look two words num PI for its random numbers and we can set the seed here like
so.
And then from tensor flow we're going to import set underscore random underscore seed and we're going
to call this method here set on a scale random underscore seed and we'll provide another lucky number
say like 4 or 4 let's hit shift enter on this and add a new cell below.
Here we can import a few things that we're gonna need like we're going to import os we're gonna import
num pi as MP We're gonna import tensor flow as TAF and we want to import Caris.
So let's hit shift enter on the cell now and see if this works.
Now if you managed to install the tensor flow and the cares packages properly then you should get something
similar to what I'm seeing where it says using tensor flow back end.
This is a message from carers because carers can actually run on a number of different technologies.
We're gonna be using tensor flow to power across the image data set that we'll be using in this module
is called sofar 10.
It contains 60000 images from 10 different classes including things like ships horses and trucks.
It's a data set that's commonly used to train image recognition models and that's exactly what we'll
be doing to get the data.
You'd probably have to go to somewhere like C.S. thought Toronto dot edu and this is the website of
a chap called Alex Chris Chayefsky who's got the zip files here for you to download.
But our life is actually gonna be much easier than that.
Thanks to Chris because all we have to do is in our input statements we'll see from Chris thought datasets
import and then sofar 10.
This is the one we're gonna go for.
So if I had shift into here then I can import the data by writing sofar 10 dot and then load on the
score data parentheses.
Now what's very interesting about this is that this will actually return a tuple for me.
If you pull up the quick documentation you can see that we actually get to tuples one for the training
data and one for the test data.
So what we actually want to do is we want to store all this information like so.
So I'll set up my tuple with some parentheses and I'm going to store my training data in X on a squat
train underscore all and then I'll have a comma here and I'll say why on a squat train on the square
all.
And my test data store under X on a score test come up y on a score test.
So this load data method from this carries data set will give us two tuples.
This one here and this one hit and hitting shift and her on the cell will download all the data for
us.
That's pretty handy right here if you're a little bit more curious and are wondering what the CFR 10
thing actually is.
Then you'll see that this is a module and if you're wondering what we get back from the load data method
with a type X going to sort of train underscore all you'll see that we get back a numb pie array.