compute the derivate of square frobenius nom

88 Views Asked by At

I wan compute the derivative of the following function $F(P)=||P^TX-P^TYZ-LP^TX+A||_F^2$ with $P$ is a $(d,p)$ matrix ,$X$ a $(d,n)$ matrix ,$Y$ a $(d,m)$ matrix ,$L$ a $(p,p)$ matrix , $Z$ a $(m ,n)$ matrix and $A$ a $(p,n)$ matix when calculating the derivative I end up with $\frac{dF(P)}{dP}=(X-YZ-XL)(P^TX-P^TYZ-LP^TX+A)^T$. What confuse me here is that the $XL$ is mathematically impossible because $X$ is $(d,n)$ matrix and $L$ is a $(p,p)$ matrix Can someone help me to figure it out how compute the right derivative of this function please.

1

There are 1 best solutions below

0
On

For convenience, define a new matrix variable $$\eqalign{ M &= X^TP - Z^TY^TP - X^TPL^T + A^T \cr }$$ Write the function in terms of the Frobenius (:) Inner Product and this new variable. Then it is simple to find the differential and gradient $$\eqalign{ F &= M:M \cr\cr dF &= 2\,M:dM \cr &= 2\,M:(X^T\,dP - Z^TY^T\,dP - X^T\,dPL^T) \cr &= 2\,(XM - YZM - XML):dP \cr\cr \frac{\partial F}{\partial P} &= 2\,(XM - YZM - XML) \cr\cr }$$ Note that there is no $XL$ term in this result.