I struggle with taking the derivative of the following equation:
$\frac{∂}{∂B}Tr(A(B⊙C))$
where A,B,C are matrices, $Tr(.)$ is the trace of a matrix, and ⊙ is the Hadamard product.
I appreciate any help.
I struggle with taking the derivative of the following equation:
$\frac{∂}{∂B}Tr(A(B⊙C))$
where A,B,C are matrices, $Tr(.)$ is the trace of a matrix, and ⊙ is the Hadamard product.
I appreciate any help.
Copyright © 2021 JogjaFile Inc.
The trace is equivalent to the inner/Frobenius product, i.e. $\,\,X:Y={\rm tr}(X^TY)$.
And the Hadamard and Frobenius products commute, $X\odot Y:Z=X:Y\odot Z$.
So the function can be written in a form that's simple to differentiate $$\eqalign{ f &= A^T:C\odot B \cr &= A^T\odot C:B \cr\cr df &= A^T\odot C:dB \cr\cr \frac{\partial f}{\partial B} &= A^T\odot C \cr\cr }$$