Partial derivative of matrix and vector

989 Views Asked by At

Now assume $ M $ is a matrix and $x, y$ are vectors with different size.

And I have a function $$ f(x, y) = \frac{1}{2}||M - xy^\top||^2_F $$ What will be the first order derivative with respect to $x$ and $y$ separately?

And what if $x, y$ are matrices?

My thought is $\nabla f_x = (M-xy^\top)y$ and $\nabla f_y = x(M-xy^\top)$.

Is these correct?

1

There are 1 best solutions below

3
On

When I refer to another post, Matrix Partial Derivative.

The result should be $$\nabla f_x = (xy^\top-M)y$$ and $$\nabla f_y = x^\top(xy^\top-M)$$.

But I still have the question: consider both $x$ and $y$ are the column vector, then the partial derivative of $x$ is a column, while the partial derivative of $y$ is a row vector. Could any one explain why?