how come this $\frac {\partial \hat y} {\partial W^{(2)}}$ in derivative

11 Views Asked by At

I have the following function: $$ \frac {\partial J}{\partial W^{(2)}} = \sum \frac {\partial \left( \frac {1}{2}(y-\hat y)^2 \right)} {\partial W^{(2)}} $$

Unlike $\hat y$ which depends on $W^{(2)}$, $y$ is constant. So,$\frac {\partial y} {\partial W^{(2)}} = 0$ and we have the following:

$$ \frac {\partial J}{\partial W^{(2)}} = - \sum (y-\hat y) \frac {\partial \hat y} {\partial W^{(2)}} $$

Could you please explain how come this part of function $\frac {\partial \hat y} {\partial W^{(2)}}$?