Coding has been the bread and butter for
developers since the dawn of computing.
We're used to creating applications by breaking down
requirements into composable problems
that can then be coded against.
So for example, if we have to write
an application that figures out a stock analytic,
maybe the price divided by the ratio,
we can usually write code to get
the values from a data source,
do the calculation and then return the result.
Or if we're writing a game
we can usually figure out the rules.
For example, if the ball hits
the brick then the brick should
vanish and the ball should rebound.
But if the ball falls off the bottom of
the screen then maybe the player loses their life.
We can represent that with this diagram.
Rules and data go in answers come out.
Rules are expressed in
a programming language and data can come from
a variety of sources from
local variables all the way up to databases.
Machine learning rearranges this diagram
where we put answers in data
in and then we get rules out.
So instead of us as developers figuring
out the rules when should the brick be removed,
when should the player's life end,
or what's the desired analytic for any other concept,
what we will do is we can get a bunch of
examples for what we want to
see and then have the computer figure out the rules.
Now, this is particularly valuable for problems that
you can't solve by figuring the rules out for yourself.
So consider this example, activity recognition.
If I'm building a device that detects if somebody is say
walking and I have data about their speed,
I might write code like this
and if they're running well that's
a faster speed so I could adapt my code
to this and if they're biking,
well that's not too bad either.
I can adapt my code like this.
But then I have to do golf recognition too,
now my concept becomes broken.
But not only that,
doing it by speed alone of course is quite naive.
We walk and run at different speeds uphill and
downhill and other people
walk and run at different speeds to us.
So, let's go back to this diagram.
Ultimately machine learning is very
similar but we're just flipping the axes.
So instead of me trying to express the problem as
rules when often that isn't even possible,
I'll have to compromise.
The new paradigm is that I get
lots and lots of examples and then I have
labels on those examples and I use
the data to say this is what walking looks like,
this is what running looks like,
this is what biking looks like and yes,
even this is what golfing looks like.
So, then it becomes answers and data
in with rules being inferred by the machine.
A machine learning algorithm then
figures out the specific patterns in
each set of data that
determines the distinctiveness of each.
That's what's so powerful and
exciting about this programming paradigm.
It's more than just a new way
of doing the same old thing.
It opens up new possibilities
that were infeasible to do before.
So in the next few minutes,
I'm going to show you the basics of creating
a neural network which is
the workhorse of doing this type of pattern recognition.
A neural network is
just a slightly more advanced implementation of
machine learning and we call that deep learning.
But fortunately it's actually very easy to code.
So, we're just going to jump straight into deep learning.
We'll start with a simple one and then we'll move on
to one that does computer vision
in about 10 lines of code.
But let's start with a very simple "Hello World" example.
So you can see just how everything hangs together.