What is the partial derivative of the following expression with respect to $U_i,V_j$ and M, respectively: $$L=\sum_{i}^m \sum_{j}^n(P_{ij} - g(U_i^T M V_j))^2 $$ where $$ U \in R^{d*m} , V \in R^{d*n}, M \in R^{d*d} , P\in R^{m*n} $$ are matrices.
thanks.
the full answer seen in the text 'linear algebra with applications'by Bernard Kolman where M is constant matrix.