How to take derivative of $f({Z}) = Tr({Z}{U}^T{Z}^T{Z}{U}{Z}^T)$ with respect to ${Z}$?
Where $Tr$ is the trace operator and ${Z}$ and ${U}$ are both matrix. ${Z}^T$ means the matrix transpose.
How to take derivative of $f({Z}) = Tr({Z}{U}^T{Z}^T{Z}{U}{Z}^T)$ with respect to ${Z}$?
Where $Tr$ is the trace operator and ${Z}$ and ${U}$ are both matrix. ${Z}^T$ means the matrix transpose.
Copyright © 2021 JogjaFile Inc.
Let $\,\,X=ZUZ^T$
then write the function in terms of this new variable, find the differential, then the gradient $$\eqalign{ f &= {\rm tr}(X^TX) \cr &= X:X \cr df &= 2X:dX \cr &= 2X:(dZ\,UZ^T+ZU\,dZ^T) \cr &= 2(XZU^T + X^TZU):dZ \cr \frac{\partial f}{\partial Z} &= 2(XZU^T + X^TZU) \cr &= 2\big(ZUZ^TZU^T + ZU^TZ^TZU\big) \cr }$$ where colon $(:)$ denotes the trace/Frobenius product, i.e. $\,\,A:B={\rm tr}(A^TB)$