First order derivation with respect to a matrix

807 Views Asked by At

I got stuck into solving the first differentiation of below equation with respect to Matrix A: [\begin{array}{l} {F = { {{{\left( {{p^T}{A^T}\alpha + \eta } \right)}^2}} }} \end{array}

Where A is a matrix, p and $\alpha$ are vectors. A is $D \times D$, p and $\alpha$ are $D \times 1$. m, n, $\eta$ are scalars.

From a book I know that: \begin{array}{l} \frac{{\partial {a^T}{X^T}b}}{{\partial X}} = b{a^T} \end{array} Where X is matrix and a and b are vectors.

What is $\frac{ \partial F }{\partial A}$ ?

Any Attention is highly appreciated.

1

There are 1 best solutions below

0
On

Let's use a colon to denote the trace/Frobenius product, i.e. $$A:B = \sum_{i=1}^m \sum_{j=1}^n A_{ij} B_{ij} \;\doteq\; {\rm Tr}(AB^T) $$ and for typing convenience, let's define the scalar $$\eqalign{ \mu &= {p^T}{A^T}\alpha \\&= \alpha p^T:A \\d\mu &= \alpha p^T:dA \\ }$$ Now we can calculate the differential and gradient of the function as $$\eqalign{ F &= (\mu+\eta)^2 \\ dF &= 2(\mu+\eta)\,d\mu \\ &= 2(\mu+\eta)\,(\alpha p^T):dA \\ \frac{\partial F}{\partial A} &= 2(\mu+\eta)\,(\alpha p^T) \\ }$$ As noted elsewhere, setting $$A = -\left(\frac{\eta X}{p^TX^T\alpha}\right)$$ yields a gradient of zero, for any matrix $X$ for which the denominator is non-zero.
A particularly simple choice is the rank-one matrix $$X = \alpha p^T$$