Derivative of a trace (Graph regularization) with Hadamard product

39 Views Asked by At

Let us assume that $A,M,L\in \mathbb{R}^{n \times n}$. The symbolic $ \circ $ represents Hadamard product. I am trying to partial derivative the following expression: $$ F=Trace((A \circ M)L(A \circ M)^T) $$ with respect to $A$. i.e.: $$ \frac{\partial F}{\partial A}=? $$ I've been stuck with this problem for a week! I appreciate any help.

1

There are 1 best solutions below

2
On

Let me answer my own question Let $B=A \circ M$,so $F={\rm Tr}(BLB^T)$

According to the chain rule, $\frac {\partial F}{\partial A_{ij}}=\frac {\partial F}{\partial B}\bullet\frac{\partial B}{\partial A_{ij}}$.

$$\frac {\partial F}{\partial B}=\frac{\partial Tr(BLB^T)}{\partial B}=B(L+L^T)$$

$$\frac {\partial B}{\partial A_{ij}}=\frac{\partial (M \circ A)}{\partial A_{ij}}=M \circ E_{ij}$$ where $E_{ij}$ is the matrix whose $(i,j)^{th}$ component equals $\tt1$ and all others equal zero.

Combining $\frac {\partial F}{\partial B}$ and $\frac {\partial B}{\partial A_{ij}}$ gives us

$$\frac {\partial F}{\partial A}=B(L+L^T) \circ M$$