Partial derivative of e

81 Views Asked by At

Lets say I want to do partial derivative in respect to $w$:

$$ \frac{\partial e^{w^T\phi(x^i)}}{\partial w} $$

Where $w$ is a vector and $\phi(x^i)$ is a also a vector.

Can I treat $\phi(x^i)$ like a scalar, so that, the derivative will be:

$$ \frac{\partial e^{w^T\phi(x^i)}}{\partial w} = \phi(x^i)e^{w^T\phi(x^i)} $$

?

Thank you

2

There are 2 best solutions below

0
On BEST ANSWER

From the looks of it, it seems that both $w$ and $\phi$ are vectors, the good thing is that you can write this in components

\begin{eqnarray} \frac{\partial}{\partial w_k}e^{w^T\phi(x^i)} &=& e^{w^T\phi(x^i)}\frac{\partial}{\partial w_k} (w^T\phi(x^i)) \\ &=& e^{w^T\phi(x^i)}\frac{\partial}{\partial w_k} \left(\sum_jw_j\phi_j(x^i)\right) \\ &=& e^{w^T\phi(x^i)} \phi_k(x^i) \\ &=& (\phi(x^i))_k e^{w^T\phi(x^i)} \\ &=& \left( \frac{\partial}{\partial w}e^{w^T\phi(x^i)} \right)_k \end{eqnarray}

In vector form

$$ \frac{\partial}{\partial w}e^{w^T\phi(x^i)} = \phi(x^i) e^{w^T\phi(x^i)} $$

0
On

By the chain rule, you certainly have

$$\frac{\partial e^{w^T\phi}}{\partial w}=\frac{\partial({w^T\phi})}{\partial w}e^{w^T\phi}$$

and if your operator denotes the gradient, it is not difficult to show

$$\frac{\partial({w^T\phi})}{\partial w}=\phi.$$