Computing the gradient of "l2 regression"

78 Views Asked by At

Given an invertible matrix $G \in \mathbb{R}^{d \times d}$, what is the gradient of the following function w.r.t. $x$: $$ \left\| Gx\right\|_2^2$$

Also, is this function smooth!?

Please advise.

Thanks in advance.

1

There are 1 best solutions below

0
On BEST ANSWER

Write the function in terms of the inner/Frobenius product (which I'll denote with a colon) $$f=\|Gx\|^2_F = Gx:Gx$$

Then finding the differential and gradient is pretty straightforward $$\eqalign{ df &= 2\,Gx:G\,dx \cr &= 2\,G^TGx:dx \cr \cr \frac{\partial f}{\partial x} &= 2\,G^TGx \cr\cr }$$