What is the relation between the gradient and the Jacobian matrix here?

284 Views Asked by At

For $f:\mathbb{R}^n \rightarrow \mathbb{R}$ and $g:\mathbb{R}^n \rightarrow \mathbb{R}^m$ $$ f(x) = \frac 1 2 \left\Vert g(x)\right\Vert^2_2 $$

How to show that $$ \nabla f(x) = J_g(x)^T g(x) $$?

3

There are 3 best solutions below

1
On BEST ANSWER

\begin{align*} f(x)=\dfrac{1}{2}[(g_{1}(x))^{2}+\cdots+(g_{m}(x))^{2}], \end{align*} so \begin{align*} \dfrac{\partial f}{\partial x_{i}}(x)&=\dfrac{1}{2}\cdot2\left[g_{1}(x)\dfrac{\partial g_{1}}{\partial x_{i}}(x)+\cdots+g_{m}(x)\dfrac{\partial g_{m}}{\partial x_{i}}(x)\right]\\ &=g_{1}(x)\dfrac{\partial g_{1}}{\partial x_{i}}(x)+\cdots+g_{m}(x)\dfrac{\partial g_{m}}{\partial x_{i}}(x), \end{align*} the rest is just writing down the big matrix.

0
On

It is an application of chain rule. Let $\varphi: y \mapsto (\sum_{1}^{m}y_{i}^{2})/2$; then $$ f: x \mapsto g(x) =: y \mapsto \varphi(y), \mathbb{R}^{n} \to \mathbb{R}. $$ So, given that the conclusion of your interest takes that form, we have $$ \nabla f(x) = (\nabla \varphi(y)' Dg(x))^{\top} = ((y_{1}, \dots, y_{m})Dg(x))^{\top} = Dg(x)^{\top}g(x). $$

0
On

Write $$ f(x) = \frac12\left\Vert g(x)\right\Vert^2_2 = \frac12\langle g(x),g(x)\rangle. $$ and apply Frechet derivative for bilinear map.