LAURENCE MORONEY: Previously, we explored
what machine learning is.
And we saw that it's a new technique for programming
computers where, instead of a developer figuring out
the rules to get an answer, like where
the bat should move in a game of Pong,
that a computer, when given data,
could instead figure out the patterns that match that data
to the desired outcome.
And while this could be used to do something like moving about
in Pong, it's also available for far more interesting scenarios,
like determining if this eye is diseased or not.
And while a doctor could do that,
the technique in this case could extend to other things,
such as understanding birth-assigned gender or even
things like age from just a retina scan.
And those possibilities open up new scenarios that
were not previously possible.
In those cases, because the computer
learned to do things like to see the way an intelligent being
does, we use terms like machine learning
and artificial intelligence.
In this video, I'll go a little deeper into the
how to, again, show that there's no real magic here.
It's just computer programming.
And as always, if you have any questions,
leave a comment down below.
I'll start with the idea of a neural network, which
begins with just a neuron.
Consider a simple function in mathematics,
like that function which describes a line.
And don't worry, this is really the only math
I'm going to be doing in this series.
The equation of a line is y equals
Wx plus B. In other words, to get the y
value for a particular x value, you
multiply x by a value, called W, for the weight,
and add the result to another value, called B, for bias.
So for example, if I say W equals 3 and B equals 2,
I'll get a line that looks like this.
And you can see, when x is 1, y is 5.
When x is 2, y is 8.
When x is 0, y is 2, and so on.
And we can see that these dots all line up
and they will continue to do so.
In this case, I know my x, I want my y,
and in order to get it, I need two other values.
And I'm going to call those parameters,
so that when I know what those parameters are,
I'm going to have my line.
So what if I draw this line?
Can I figure out what the W and B values are?
Well, I could start by listing out a few values like this--
so when x is minus 2, y is minus 5.
When x is minus 1, y is minus 3.
When x is 0, y is minus 1, and so on.
If I think about it this way, x is my data.
y is my answer.
I need to figure out the rules that
will get me my y from my x.
It's a line, so I know that y equals Wx plus B. Thus,
if I can figure out what W and B are,
I'll have the rule that gets me my answer from my data
to give me a line, right?
So let's go back here.
How would you do that?
You might start with a guess.
And in this case, the guess might
be W equals 5 and B equals 5.
So you could try to get the answers for that guess
and then compare them with the real answers,
and you'd be way off.
And you'd use that, then, maybe to make
another set of guesses--
so maybe W equals 2 and B equals 2.
So then calculate the y with those parameters,
and you're still wrong, but it looks a little bit better.
So then you could make another and another and another guess
and you'll probably get a little bit closer each time.
And what you've just done is very similar to the process
of machine learning.
So I like to draw it like this.
First, we make a guess.
Then we measure the accuracy of that guess,
and this is sometimes called the loss or the cost.
And then you use that data to make another guess in a process
called optimization.
Now, the logic is that if you're doing this correctly,
then the loss gets reduced.
That's a fancy math term for just saying
you're getting closer to the correct answer.
You keep trying again and again with a view to making
the loss as small as possible, and eventually you'll
figure out that for this line, W equals 2 and B is minus 1.
So by going through all of those steps,
you could say that from a certain point of view,
that your machine has learned how to match x to y correctly.
That's what gives us the term machine learning.
This process is often drawn like this,
with the function being the circle in the middle,
the x is coming in, and the answer, y, is going out.
Now, this looks a little bit like a neuron in the brain,
which really looks like this.
And then, just like the neuron in the brain,
even though its task is very, very simple--
just learning a weight and a bias--
when you put a lot of them together
and you have them learn to match inputs to outputs,
you get a neural network, which can learn really smart things,
like the computer vision that we talked about earlier.
And you'll see how that works in the next video.
So please like, share, and subscribe to the Google
Developers channel.
And most of all, enjoy this series.
[MUSIC PLAYING]