Derivation of gradient for non negative matrix factorization I am looking at a paper for non-negative matrix factorization and can't seem to figure out the derivation for the gradient. The function is as follows:
$f(W,H) = \frac{1}{2}||V-WH ||^2_F$ 
Where V is fixed.
The resulting gradients are:
$\nabla_W f(W,H) = (WH-V)H^T $
$\nabla_H f(W,H) = W^T(WH-V) $
I tried looking up rules in various reference manuals but never got anything solid. Even a hint / solid resource would be incredibly helpful.

For convenience, define the variable
$$\eqalign{
 M &= WH-V \cr
}$$
Write the function in terms of the double-dot (aka Frobenius) product and this new variable. In this form it's easy to find the differential
$$\eqalign{
 f &= \frac{1}{2}\,M:M \cr\cr
df &= M:dM \cr
   &= M:(dW\,H+W\,dH) \cr
   &= MH^T:dW + W^TM:dH \cr\cr
}$$
Setting $dH=0$ yields the gradient wrt $W$
$$\eqalign{
\frac{\partial f}{\partial W} &= MH^T \cr
}$$
while setting $dW=0$ yields the gradient wrt $H$
$$\eqalign{
\frac{\partial f}{\partial H} = W^TM \cr\cr
}$$
Double-dot products can be rearranged in a variety of ways, e.g.
$$\eqalign{
 AB:C &= A:CB^T \cr
   &= B:A^TC \cr
}$$ which follow from its equivalence to the trace $$A:B=\operatorname{tr}(A^TB)$$ and the cyclic properties of the trace.
