Now that we've converted our image into an array of numbers we can start looking more closely at the
models.
And something called the graph.
If you head on over to Caris dot Io slash applications you can actually see all the models that are
available to us with a few lines of code.
Now on this list there is a model called Inception rez net version 2.
So if I click on it I get to see all the documentation pertaining to this model and how to use it.
So let's make sense of this documentation and then implement this in our Python code in this documentation.
We can already see a couple of things.
First off we see where we can import the model from.
So this Inception resonant version to model lives under Kerry's start applications dot Inception and
a score resonant version too.
And what we also see is that we can use the pre train weights simply by specifying that weights should
be equal to image net.
This is what the documentation is saying down here it's giving us the choice of either training this
model ourselves and trying to figure out our own weights or using the pre train weights that we're trained
on image net.
Now image Net itself is actually very interesting.
So let me just quickly explain what image net is and why you might see its name come up a lot on anything
to do with computer vision and machine learning image that is actually a high quality database of roughly
around 14 million images created and maintained by Princeton and Stanford University.
The goal of this image net project was to give researchers access to high quality images that were labeled
and this is the key.
The images on image net have labels on them so that these images can be then used to train machine learning
models.
In other words there is an annotation with each image that goes something like this image contains calls
or there are no calls in this image and these annotations were actually done by hand for the millions
of images in this dataset.
Now if annotating millions of images sounds like a really boring job to you then ask you if you've ever
seen any of these types of things before.
So if you've ever had to sign into a Web site or sign into an app sometimes you're prompted by these
prove that you're not a robot type of exercises.
And these ones are actually called recapture and apparently the way we supposed to prove that we're
not robots is by selecting the images that contain say street signs or storefronts or buses or what
have you.
Well guess what.
Every time we do this we're actually annotating images for Google.
That's right.
We're doing work for Google so that they can then feed this database with annotated images into their
own neural networks horror machine vision programs fun times.
Right.
But back to image net and Caris let's actually load this Inception dot resonant model into our core
lab notebook as per the documentation we're going to see from Charisse dot applications dot Inception
underscore resonant underscore V2 import Inception resonant V2 and you're going to pick this one here.
Capital AI and one word now hit shift enter and then down here.
We're going to insert a markdown cell that reads load Inception resonant I'm going to add some notebook
magic with.
Percent percent time because I want to show you how long this actually takes and then I'm going to store
our model in a variable called Inception underscore model and I want to set that equal to Inception
resonant v 2 and then open parentheses weights is equal to single quotes.
Imagine it all lowercase.
There we go.
That's all we have to do.
If we look back at the documentation we can see that for all the other arguments there's a default value
and we can see that we don't have to supply any additional information to get started.
So let me hit shift enter on the cell and let's watch what happens the very first thing that I see is
a warning and scrolling over I can actually see this is some sort of deprecation warning.
So the people maintaining Caris will probably have to do some work to update this in the future.
And then what we see is actually that a download started and all of this took a total of 45 seconds
until it finished.
So what did it download Exactly.
Well when you scroll over here you can see that the file is called Something something waits on a score
tensor flow underscore time ordering underscore etc etc..
Colonel Stone Age 5.
This here is the name of the weights file that was trained on image net.
This is what we've downloaded and applied to our inception Resnick model.
Now Inception resonant is actually quite a complex neural network.
It's a specialized type of neural network called a convolution all neural network.
So it's definitely on the more complicated side and its structure actually looks something like this.
The one thing I wanted to show you here is that there are certain subtypes of neural networks that have
shown particular promise with particular tasks and the convolution all neural networks have shown particular
promise when it came to computer vision which is why we're gonna be using this kind of model for our
classification exercise here.
Once we got our inception model loaded we can take our inception model into the next part of the setup.
So Inception model dot graph is equal to T F tensor flow don't get default graph and parentheses at
the end lets it shift enter.
Now even though this looks like it didn't really do much setting up the graph intensive low is actually
key.
You see every time you work with tensor flow you're gonna be working with something called a graph tensor
flow is what we're using that will do the calculations for us here in this case.
Caris will provide the neural network but tensor flow will do our calculations and for tensor flow to
do its calculations it will need to actually organize the computation and the way it does this is by
putting all the computations into something called a graph.
This is a really strange concept that refers to wrap your head around but we'll get a chance to talk
about this a lot more detail for now.
What I want to do is I want to show you a picture of what a graph actually looks like.
This is not the graph for our current project but it would be the graph for our next project.
So this would be a bit of a look into the future.
What we're looking at here is the example graph for all the calculations that are taking place and our
next project.
The point is is that tensor flow will use something called a graph to organize its calculations.
Some of these calculations might have to do with training the neural network.
Like doing all the calculations inside the individual layers.
Other bits of the graph pertain to doing all the calculations to estimate the loss and then other bits
of the graph have to do with calculating the accuracy of the model.
Basically the graph represents all the calculations that you're asking tensor flow to do.
Now of course some of these calculations have to do with training the neural network but other bits
might be related to the analytics or they might be related to something completely different.
For example here there are some calculations that have to do with showing the image on screen.
All of these things are represented as individual nodes inside this thing called the tensor flow graph.
That's the reason I'm showing you this slide it nicely illustrates this concept and it allows us to
get a bit more familiar with some of this tensor flow specific vocabulary.
The good news is that we're pretty much done with our setup and now we get to use our model to make
a classification using our sample images so we'll check that out in the next lesson and see how that
works.
I'll see you there.