I have to find the gradient of the following term with respect to $X_{1}$:
$\|\Phi\circ(X_{1}-X_{2})-u\|_F^2$ ,
where $u\in\mathbb{R}^{n}$; $X_{1}, X_{2}\in\mathbb{R}^{N\times J}$ and $\Phi\in\mathbb{R}^{n\times NJ}$. The $\circ$ operation is defined as follows:
$\Phi\circ X=\Sigma_{i=1}^{J}\Phi_{i} x_{i}$,
where $x_i$ are the columns of $X$ and $\Phi_{i}$ are $n\times N$ submatrices of $\Phi$.
I know that $\frac{\partial}{\partial X}\|X\|_{F}^{2}=2X$, but the $\circ$ operation is making it rather complicated. Can somebody help?
P.S. Also, would changing the Frobenius norm to l2 norm make any difference here (since $(\Phi\circ(X_{1}-X_{2})-u)$ is a column vector)?