Derivative of trace of Hadamard and dot product

372 Views Asked by At

Im struggling solving an equation and I have tried to find solution in the matrix cookbook but did not find a clue. How can I calculate the derivative of the equation which is a combination of Hadamard product and dot product: $$tr(A\circ X.B(A\circ X.B)^T)$$ I am very appreciate your help.

1

There are 1 best solutions below

2
On

Let $Y=(A\circ XB)$ and write the function using the product notation (:) for the trace. $$\eqalign{ \phi &= {\rm tr}(YY^T) = Y:Y \cr d\phi &= 2Y:dY \cr &= 2Y:(A\circ dX\,B) \cr &= 2Y\circ A:dX\,B \cr &= 2(Y\circ A)B^T:dX \cr \frac{\partial\phi}{\partial X} &= 2(Y\circ A)B^T \cr }$$ This assumes that the Hadamard product has the lowest precedence.
If it actually has the highest precedence, then $$\eqalign{ d\phi &= 2Y:(A\circ dX)\,B \cr &= 2YB^T:A\circ dX \cr &= 2(YB^T)\circ A:dX \cr \frac{\partial\phi}{\partial X} &= 2(YB^T)\circ A \cr\cr }$$