The matrix problem is given by: $$y=M^T * A \circ B$$ where $M\in\mathbb{R}^{n}\times\mathbb{R}^m, A,B\in \mathbb{R}^{n}\times\mathbb{R}^n$
$\circ$ is Hadamart (element-wise) product and $*$ is matrix multiplication.
How do I find $\frac {\partial y} {\partial A}$?
Thanks in advance.
The componentwise gradient of a matrix with respect to its own elements is given by $$\eqalign{ \def\p{\partial} \def\LR#1{\left(#1\right)} \def\BR#1{\Big(#1\Big)} \def\grad#1#2{\frac{\p #1}{\p #2}} \grad{A}{A_{ij}} &= {E_{ij}} \\ }$$ where $E_{ij}$ is a matrix whose $(i,j)$ component is equal $\tt1$ and all others are equal to $0$.
Using this, the componentwise gradient of your function is $$\eqalign{ &Y = M^T\LR{A\circ B} \\ &\grad{Y}{A_{ij}} = M^T\LR{E_{ij}\circ B} \\ &\grad{Y}{A_{ij}} = M^T{B_{ij}} \\ }$$ where $B_{ij}$ is a matrix whose $(i,j)$ component is equal to the corresponding component of $B$ and all other components are equal to $0$.
The full gradient can be constructed by summing over the components using a dyadic/tensor product (denoted by the $\star$ symbol) $$\eqalign{ \def\S{\sum_{i=1}^n\sum_{j=1}^n} \grad{Y}{A} &= \S \LR{\grad{Y}{A_{ij}}}\star E_{ij} \\\\ }$$ Your other option is to use vectorization to flatten the equation into a vector form $$\eqalign{ \def\vecc#1{\operatorname{vec}\LR{#1}} \def\Diag#1{\operatorname{Diag}\!\BR{\!#1}} \vecc{Y} &= \LR{I_n\otimes M^T}\Diag{\vecc{B}}\vecc{A} \\ \grad{\vecc{Y}}{\vecc{A}} &= \LR{I_n\otimes M^T}\Diag{\vecc{B}} \\ }$$ where $\otimes$ denotes the Kronecker product.