$X^{i,j,\lambda}$ is a rank 3 tensor, $W^{i,j}$ is a matrix.
Is it possible to analytically solve the following?
$\frac{d}{dX}\left|| W - \sum_\lambda X \right||^{2}$
I know with matrices we can rewrite the sum over an index using a vector of ones, but dont think this applies here.
Thanks in advance!
$ \def\A{{\cal A}}\def\B{{\cal B}}\def\C{{\cal C}} \def\o{{\tt1}}\def\p{\partial} \def\LR#1{\left(#1\right)} \def\trace#1{\operatorname{Tr}\LR{#1}} \def\qiq{\quad\implies\quad} \def\grad#1#2{\frac{\p #1}{\p #2}} \def\fracLR#1#2{\LR{\frac{#1}{#2}}} $For typing convenience, define the all-ones vector $u$ and the matrix variable $M$ as $$\eqalign{ M &= \LR{X\cdot u-W} \qiq dM = dX\cdot u \\ }$$ Let's also use $\,\A\star\B,$ $\,\A\cdot\B,$ $\,\A:\B,$ $\,\A\therefore\B\;$ to denote the various products $$\eqalign{ \C &= \A\star\B &\qiq \C_{ijkpqr} &= A_{ijk}B_{pqr} \\ \C &= \A\cdot\B &\qiq \;\;\C_{ijpq} &= \sum_{k=1}^K A_{ijk}B_{kpq} \\ \C &= \A:\B &\qiq \quad\,\C_{ip} &= \sum_{j=1}^J\sum_{k=1}^K A_{ijk}B_{jkp} \\ \C &= \A\therefore\B &\qiq \qquad\C &= \sum_{i=1}^I\sum_{j=1}^J\sum_{k=1}^K A_{ijk}B_{ijk} \\ }$$ Write the objective function using the above notation, then calculate its differential and gradient. $$\eqalign{ \phi &= \bigl\|M\bigr\|_F^2 \\ &= M:M \\ \\ d\phi &= 2M:dM \\ &= 2M:\LR{dX\cdot u} \\ &= \LR{2M\star u}\,\therefore\, dX \\ \\ \grad{\phi}{X} &= 2M\star u \\ \\ }$$