Welcome back everyone.
I am so excited for this next section and of course we're starting off with our six step machine learning
modeling workflow.
We're going to Problem Definition Data Evaluation features modeling and experiments.
Again we're trying to just make this almost second nature with whatever machine learning modeling tasks
we come across.
If we've got some data these are some steps that we can take to figure out insights from that data.
Now let's have a look at what tools we can use and what's important is that in this section we're going
to have a look at tensor flow And now you might be wondering OK I see part torch here I see socket line
I see we've already had a look at socket line.
But what is tensor flow.
Well that's what we're going to be diving into in this entire section.
And we're kind of going to be teaching this one a little bit differently to how we've looked at the
panda's map properly no hindsight and Loan Section.
Now the reason being is because the book on tensor flow in the book on deep learning and no networks
are what we're going to cover in this section is not as established yet as what socket learn is the
socket loan's been around for over 10 years whereas tensor flow the version we're about to use only
came out a couple of months ago.
So if you're watching this in 2020 or later on really the version of tensor flow tends to flow 2.0.
It might be a higher version by now only came out at the end of 2019.
So what we're doing in this section is we're using cutting edge stuff.
And what's even more exciting is that we've got a new contender to our workspace environment.
That's Google collab.
Now the reason being is because we're gonna need access to a GP you will have a look at that in a second
but this is our workspace that we're gonna be using for this section.
Now if you're not familiar with Google Ecolab that's okay we're gonna go through it it's very similar
to a Jupiter notebook.
Now you might be thinking what is tensor flow.
And that's a great question.
Well that's a flow is a deep learning or numerical computing library.
That's probably a better term for it.
Now it was first conceived by Google and they used it within their own like it was in an internal software
library for all of their deep learning and machine learning needs.
And it's actually now open source so anyone can contribute to test flow.
The most recent update this hits a flow 2.0.
It is packed full of updates of the community.
The people like yourself and me who use tensor flow have asked for like Hey this didn't really work.
Can we make it a bit better.
So older versions had the flow you don't have to worry about what we're covering is the latest stuff
here.
There's a flow is used to build deep learning and no network models to gain insights out of unstructured
data.
Now in the previous projects we've dealt with data that's available in a data frame so something that
looks like an Excel spreadsheet it has rows and columns but deep learning is more suited to unstructured
data such as photos or audio waves or natural language text unstructured data that doesn't really have
any specific structure and now tensor flow allows us to build a deep learning model kind of like a no
network.
Well exactly like a known network to gain insights out of this unstructured data and it also allows
us to check and evaluate how our neural network which is another form of machine learning model is doing.
Is it getting things right or is it getting things wrong now.
Why tensor flow.
Well the most important thing is that we can write fast deep learning code in Python.
Now what I mean by fast is that it's code able to run on a GP you know if you're not sure the GPO is
don't worry we'll check that in a second and tensor flows able to access many pre-built deep learning
models.
Now this is important.
So like socket learn has a bunch of machine learning models built into it.
We've already seen site get learn tensor flow also has the ability to access pre-built deep learning
models.
So we'll see how to do that in the upcoming project.
It also enables you to do the whole stack.
What I mean by that you can pre process your data using tensor flow.
You can model it using tensor flow and you can also deploy a model that you build using tensor flow
and we just spoke about this one.
It was originally designed and used in-house by Google.
Now it's open source so people like you and me we have access to exactly the same software that Google
use in-house for their deep learning and machine learning workflows and we spoke about a GPO what actually
is a GP the GP use stands for graphical processing unit and the main thing you have to know for now
is that it's a lot faster than a regular CPA you is at doing numerical computing.
So if you remember if machine learning is finding patterns in data a.k.a. turning data or information
into numbers finding patterns in those numbers a GP you is what's going to help us to increase the speed
of finding those patterns in those numbers.
That's all we need to know.
Now if you remember way back in that machine learning what one section.
So this is why I throwback here.
We looked at this slide choosing a model.
So we've got structured data here you might choose a model and you might use one of these libraries
unstructured data like cash boost extra boost or random forest we saw that an escalation.
Now we're going to start working with problem 2 unstructured data through our photos or audio files
here and we've got model 2 which is well like a neural network.
This is kind of what you'll see if you google up neural network and now these type of models deep learning
and transfer learning work much better on unstructured data like we've just talked about.
And so tensor flow is what we can use to build deep learning models and tend to flow.
Hub is where we'll be going to use transfer learning a.k.a. taking what one model knows and using it
in another model and you might be asking what is deep learning and what are neural networks.
Well I want you to think of it like this deep learning is just another form of machine learning and
neural network something like this.
These are the type of machine learning algorithm that are usually referred to when we talk about deep
learning.
And so if we have this image of a dog and we're trying to identify that's my dog Seven How beautiful
is she.
And that's Bella in the background.
But let's say we're trying to identify the breed of seven a no network might look at this image converted
into numbers and then go make this little model here is going to remember what a leg looks like and
then this one here is gonna remember what eyes look like and then these ones.
Who knows what they're going to figure out.
And then eventually we realize that this is an image of a labrador.
If our neural network is learning right.
So this is what I want you to imagine a neural network as is that the same process with all of our other
machine learning models that we've looked at is you have an input some kind of data and then you have
a machine learning model here.
In our case a neural network and then you have some sort of output now a no no what you may be wondering
what are all these little nodes here.
They're also called nodes.
While these are small models within themselves.
So what's going to happen here is that each of these small models is going to add up and figure out
some kind of pattern in this data and then learn what that pattern relates to a.k.a. the label.
And so where does deep learning come from if it's just if no network is just another type of machine
learning model.
Well this is where the deep part comes from when building a neural network you might use multiple layers.
I see here we've got our original one but then you might add more neural networks on top of your original
neural network.
And what this might do what this and I say might because again it's a lot of trial and error in this
sort of model finding that's why I said in the beginning the book on deep learning is yet to be fully
completed yet because we're still working out the best way to lay out these neural networks.
And so I've got here a few more boxes than what we had in the previous slide.
And what this means is that as you add more layers here these other nodes these smaller models in the
node network are going to start to be able to detect more and more features and thus hopefully getting
better at identifying the information in our unstructured data.
Now what kind of deep learning problems are there.
Well we've spoken about classification we've also seen that in a heart disease project but you might
want to classify what kind of dog breeds are in an image or whether an email is spam or not.
In this case this email is definitely not spam.
Otherwise there's a sequence to sequence problem also known as sector say and now this is a kind of
problem that happens with Siri or Google home or something like that.
It also happens with Google Translate so it takes an audio wave and it's going to translate that into
some sort of text or command.
And then finally there's object detection which is similar to image classification but now you're trying
to find out where a specific object is inside an image.
So this is a kind of deep learning problem that a self-driving car.
I have to come into or will come into if they're using cameras right it's trying to identify what objects
are in an image of a test the self-driving car has eight cameras.
It's always trying to pick up what objects are in its way.
And I mean there's many more deep learning problems out there but this is three of the main ones that
you're going to come across in your day to day life okay.
And we mentioned transfer learning before.
So what is transfer learning and why should we use it.
Well the main premise of transfer learning is taking what you know in one domain and applying it to
another.
So if you're training a machine learning model to pick up different dog breeds and images and you're
trying to train a machine learning model from scratch that can be both expensive and time consuming.
But if you've already got a machine learning model which has learned to identify other objects and images
the beautiful thing is you can use transfer learning.
So taking what that machine learning model or neural network taking those patterns that it's learned
in another set of images and then apply those patterns to your own problem.
So this leads us to question why not take advantage of what's already out there.
Why not take advantage of what another model already knows.
That's what we'll be looking at doing in this project and more specifically what are we going to cover.
Well if you remember our socket line workflow our tensor flow workflow is very similar.
We've got to get data ready.
But this time it's unstructured data rather than structured data.
And this is the main premise here.
And I would stress this until I go horse is getting the data ready is essentially just turning our data
into tenses.
Hence tensor flow and then once our data is in tenses we pick a model to suit our problem we're going
to use tensor flow hub for this and then we'll fit the model to the data.
So okay I get the model to find patterns in the data for us and we'll learn how to make a prediction.
Once our model has learned some patterns in our data then we'll evaluate our model to see if hey are
these predictions.
Are they any good or not.
We'll see how to improve through experimentation and then we'll save and reload our trained model
now in a dot point form.
We're going to go through an end to end multi class classification workflow intensive low.
We'll see what that is in a second.
We'll learn how to pre process image data so getting it into tenses we'll learn how to choose a deep
learning model.
We'll learn how to fit it to the data so learning the patterns.
Then we'll learn how to make predictions without deep learning models so using the patterns that it's
learned then will evaluate our models predictions we'll save and load our deep learning model and then
we'll use a trained model to make predictions on our own custom data.
How far out is a big section.
But I'm excited now.
What is the problem.
We're going to work on as a classification problem and it's the Kaggle dog breed identification problem.
So determine the breed of a dog in an image.
And now this kind of problem is multi class classification so that means there is more than two options
but we'll have a look at this shortly.
Now where can you get help with all of this.
Because we're learning concepts and code at the same time all within a project.
Do your best to follow along with your code.
If in doubt run the code remember try it for yourself because we're using Google collab.
We'll see this in a second reading a doctoring is a little bit different to our Juba notebook.
You have to press shift command and space to read it.
If you're still stuck Don't be afraid to search for it.
You'll come across stack overflow or the Texans of faux documentation and then try again using what
you found on stack overflow or tensor flows documentation and then finally if you're still stuck.
Never be afraid to ask and of course don't forget discord chat which hopefully you're signed up to.
Hopefully you're in there interacting with the other students and now without any further ado let's
go find those dog eyes.