Week2 why dw1=x1dz

Yes, in Prof Ng’s notation the dz means a partial derivative of L w.r.t. z, so this is just the Chain Rule in action.

Remember that the formulas are:

L(y, a) = -y log(a) - (1 - y) log(1 - a)
a = \sigma(z)
z = \displaystyle \sum_{i = 1}^{n_x} w_i x_i + b

And then we have the full Chain Rule expression:

\displaystyle \frac {\partial L}{\partial w_1} = \frac {\partial L}{\partial a}\frac {\partial a}{\partial z}\frac {\partial z}{\partial w_1}

Of course you can see from the above equations that:

\displaystyle \frac {\partial z}{\partial w_1} = x_1

And we can rewrite the full Chain Rule expression with this simplification:

dz = \displaystyle \frac {\partial L}{\partial z} = \displaystyle \frac {\partial L}{\partial a} \frac {\partial a}{\partial z}

3 Likes