My question is regarding an assignment our professor gave us. In it, at one point we have to find the gradient of a function $:\\L : \mathbb{R}^{n,n} \times \mathbb{R}^n \rightarrow \mathbb{R}, L(M,m) = ||M||_F^2 + m^T*(M*z - g)$
As differentiation of functions taking matrices as arguments can get incredibly cumbersome, we were instructed to resort to "high level differentiation", i.e. treat matrices and vectors as scalars while keeping in mind the intricacies of not having a scalar. This high level differentiation works most of the time, but in this case it does not.
Specifically, the partial derivative in regards to M is problematic. I would get:
$\partial_ML(M,m) = 2 * M + m^T * I * z = 2 * M + m^T * z$, where $I$ is the identity.
Obviously, this is obviously incorrect, as can be seen by the dimension mismatch of adding a scalar to a matrix. Unfortunately, the master solution does not give any explanation, it only states:
$\partial_ML(M,m) = 2 * M + m * z^T$.
What am I missing?
Thanks in advance,
Felix