How to compute the derivative $f(X) = \|\mathcal{P}_\Omega(X-A)\|^2_F$?

50 Views Asked by At

How to compute the derivative $$f(X) = \| \mathcal{P}_\Omega(X-A)\|_F^2$$

here $\mathcal{P}_\Omega(\cdot)$ is a projector, $[\mathcal{P}_\Omega(Y)]_{ij} = Y_{ij}$ if $(i,j)\in \Omega$, zero otherwise.

How to compute

$$\frac{\partial f(X)}{\partial X}$$

thanks

1

There are 1 best solutions below

0
On BEST ANSWER

Define the matrices $$ ----------\\ P_{ij}=\begin{cases}1\quad{\rm if\,\,} i,j\in\Omega\\0\quad{\rm otherwise}\end{cases}\\ ----------\\ Y = P\odot(X-A) $$ Write the function in terms of these new variables. Then find its differential and gradient. $$\eqalign{ f &= \|Y\|_F^2 = Y:Y \cr df &= 2Y:dY = 2Y:P\odot dX = 2P\odot Y:dX = 2Y:dX \cr \frac{\partial f}{\partial X} &= 2Y = 2P\odot(X-A) \cr }$$ where $(\odot)$ denotes the elementwise/Hadamard product, and $(:)$ denotes the trace/Frobenius product, i.e. $$\eqalign{ A:B = {\rm Tr}(A^TB) }$$ Also note that the projection operation is idempotent, i.e. $\,P\odot P=P$