video_id
stringclasses
7 values
text
stringlengths
2
29.3k
5DUQ3-Y_gX4
you need to multiply by a row vector.
5DUQ3-Y_gX4
Another way of thinking about it is you
5DUQ3-Y_gX4
need to take the dot product--
5DUQ3-Y_gX4
ALAN EDELMAN: The vector and the scalar out.
5DUQ3-Y_gX4
STEVEN G. JOHNSON: The vector and scalar out-- sorry.
5DUQ3-Y_gX4
You need to multiply it by a one row thing.
5DUQ3-Y_gX4
Another way of thinking about it is
5DUQ3-Y_gX4
that, if you have a linear operation that
5DUQ3-Y_gX4
takes a vector in and gives you a scalar
5DUQ3-Y_gX4
out, the only type of thing that does that is a dot product.
5DUQ3-Y_gX4
If you take a dot product of the vector, you get a scalar.
5DUQ3-Y_gX4
And that's the only linear operation
5DUQ3-Y_gX4
that gives you a scalar from a vector in some sense.
5DUQ3-Y_gX4
And so this is a dot product with some vector.
5DUQ3-Y_gX4
That vector must be pretty special.
5DUQ3-Y_gX4
And so we'll give it a name.
5DUQ3-Y_gX4
And we'll call that the gradient.
5DUQ3-Y_gX4
So I think this is going to be the gradient of f.
5DUQ3-Y_gX4
And this is the thing we take the dot product with
5DUQ3-Y_gX4
to get our scalar df.
5DUQ3-Y_gX4
So you can think of this in linear algebra terms.
5DUQ3-Y_gX4
So this dot product is the same thing
5DUQ3-Y_gX4
as multiplying by a transpose.
5DUQ3-Y_gX4
So this is the same thing as--
5DUQ3-Y_gX4
this is saying that f prime is really grad f transpose.
5DUQ3-Y_gX4
Or equivalently, f prime dx is the operation
5DUQ3-Y_gX4
of a dot product with a gradient.
5DUQ3-Y_gX4
This is going to be really powerful pretty soon
5DUQ3-Y_gX4
because it's going to also allow us to generalize gradients
5DUQ3-Y_gX4
to other kinds of vector spaces.
5DUQ3-Y_gX4
As long as we have a dot product and a scalar function,
5DUQ3-Y_gX4
you'll be able to define a gradient.
5DUQ3-Y_gX4
So if you have a scalar function of-- if this is something that
5DUQ3-Y_gX4
takes a matrix in and a scalar out, like a determinant,
5DUQ3-Y_gX4
pretty soon we're going to be able to take
5DUQ3-Y_gX4
the gradient of a determinant.
5DUQ3-Y_gX4
We'll be able to define what that means.
5DUQ3-Y_gX4
ALAN EDELMAN: Just to be clear, what
5DUQ3-Y_gX4
is on the other side of that equals sign
5DUQ3-Y_gX4
that you just wrote?
5DUQ3-Y_gX4
STEVEN G. JOHNSON: So, yes, the f--
5DUQ3-Y_gX4
yeah, I should write that.
5DUQ3-Y_gX4
That's the f prime.
5DUQ3-Y_gX4
Yeah.
5DUQ3-Y_gX4
So this is-- yeah.
5DUQ3-Y_gX4
I need to-- my equals--
5DUQ3-Y_gX4
let's see.
5DUQ3-Y_gX4
The gradient of f is the thing we take a dot product.
5DUQ3-Y_gX4
And here it's f prime of x is this.
5DUQ3-Y_gX4
ALAN EDELMAN: Exactly.
5DUQ3-Y_gX4
It's f prime of x.
5DUQ3-Y_gX4
And it's not df.
5DUQ3-Y_gX4
STEVEN G. JOHNSON: Yeah.
5DUQ3-Y_gX4
It's not-- no dx.
5DUQ3-Y_gX4
Just the f prime by itself is a row vector.
5DUQ3-Y_gX4
That's the transpose of the gradient.
5DUQ3-Y_gX4
So now, that's the definition of the gradient.
5DUQ3-Y_gX4
It's only something we're usually
5DUQ3-Y_gX4
going to define for scalar functions of vectors.
5DUQ3-Y_gX4
And pretty soon, we'll be able to generalize that
5DUQ3-Y_gX4
to other kinds of vectors, but will still be a scalar.
5DUQ3-Y_gX4
And it's the thing you take the dot product
5DUQ3-Y_gX4
with of dx, of the differential, and the change in the input
5DUQ3-Y_gX4
with to get the change in the output, OK?
5DUQ3-Y_gX4
Yeah.
5DUQ3-Y_gX4
So we did-- Alan did the example of x transpose x.
5DUQ3-Y_gX4
Let's do another example just for fun.
5DUQ3-Y_gX4
So suppose f of x.
5DUQ3-Y_gX4
So x is going to be a vector.
5DUQ3-Y_gX4
Suppose that x transpose Ax where-- so this is x.
5DUQ3-Y_gX4
x here is going to have m components.
5DUQ3-Y_gX4
And so we're going to let A be an m by m matrix.
5DUQ3-Y_gX4
ALAN EDELMAN: And are you assuming asymmetric or--
5DUQ3-Y_gX4
STEVEN G. JOHNSON: No, I'm not.
5DUQ3-Y_gX4
I won't make it symmetric just for generality, OK?
5DUQ3-Y_gX4
And so this is going to be--
5DUQ3-Y_gX4
A is not going to be an input.
5DUQ3-Y_gX4
This is just going to be a constant matrix.
5DUQ3-Y_gX4
So when I do my d's, when I change x, A does not change.
5DUQ3-Y_gX4
OK.
5DUQ3-Y_gX4
So let me do it the long way first,
5DUQ3-Y_gX4
and then we'll try and derive some rules.
5DUQ3-Y_gX4
So let's do the long way--
5DUQ3-Y_gX4
long way, but still faster than doing it
5DUQ3-Y_gX4
component by component, faster than the 18.02 component
5DUQ3-Y_gX4
by component.
5DUQ3-Y_gX4
Because I could take the derivative of this with respect
5DUQ3-Y_gX4
to x1, with respect to x2, with respect to all the components,
5DUQ3-Y_gX4
and then build up the gradient.
5DUQ3-Y_gX4
It starts to become really awkward really quickly.
5DUQ3-Y_gX4
I know it can be tempting when you're faced with new problems
5DUQ3-Y_gX4
to fall back on what you know, right?
5DUQ3-Y_gX4
And that's not a bad strategy.
5DUQ3-Y_gX4
But we really want to encourage you to--
5DUQ3-Y_gX4
even though you know calculus really,
5DUQ3-Y_gX4
really well, you know how to take derivatives really, really
5DUQ3-Y_gX4
well, 18.02 and 18.01 style, we're
5DUQ3-Y_gX4
going to try and learn something new here,
5DUQ3-Y_gX4
a new way that can be really a lot more powerful besides
5DUQ3-Y_gX4
[INAUDIBLE].