Multi-variable chain rule verification

26 Views Asked by At

Given:

$E(z) = \frac{1}{2}(t-f(z))^2$

$f(z) = \frac{1}{1+e^{-z}}$

z(W) = $\sum_{i=1}^{n} w_ix_i$

I am trying to find: $\frac{\partial E}{\partial w_i}$. So far I've gotten this:

Let $u = f(z)$, therefore:

$\frac{\partial E}{\partial w_i} = \frac{\partial E}{\partial u} \frac{\partial u}{\partial z} \frac{\partial z}{\partial w_i} = (-1)(f(z))(1-f(z))(x_i)$

I made the u-substitution because I found that I got very confused on how to deal with the $\frac{\partial E}{\partial f}$ since I have never seen a partial derivative with respect to a function. Is the u-subtitution I made a correct one or have I an error?

1

There are 1 best solutions below

0
On BEST ANSWER

As written, we have $W=(w_1,\dots, w_n)$ and $F(w_1,\dots, w_n)=E\circ f\circ z(w_1,\dots, w_n)$ so that $t$ and $x_i$ and $w_j:j\neq i$ are constants, so for our purposes, $F$ is a function of $w_i$ alone; i.e. this is really just the standard one variable chain rule in disguise. So, we calculate, step by step,

$\frac{\partial E}{\partial w_i} = \frac{1}{2}\frac{(t-f(z))^2}{\partial w_i}=(t-f(z))\frac{\partial (t-f(z))}{\partial w_i}=(t-f(z))\frac{\partial f(z)}{\partial w_i}=(t-f(z))\left(-1(1+e^{-z})^{-2}\right)\frac{\partial z}{\partial w_i}=(t-f(z))\left(-1(1+e^{-z})^{-2}\right)x_i.$

Now if you want to express this a a function of $w_i$, you can subsitute for $f(z)$ and $z$