how to calculate the derivative of a kronecker product $a^T(x\otimes c)$

77 Views Asked by At

fo vectors $x,a$ and $c$ how do we calculate the derivative of

$$a^T(x\otimes c)$$

with respect to $x$ where $\otimes$ denotes the kronecker product. Here we basically build one large column vector $(x\otimes c)$. For $z:=(x\otimes c)$ we know that the solution is simply $a$. So the question is how to calculate $\frac{dz}{dx}$.

2

There are 2 best solutions below

0
On

In the indexed representation, you have the function being $\sum_i \sum_j a_{ij} x_i c_j.$ So the derivative w.r.t. $x_i$ would be $\sum_j a_{ij} c_j.$

Alternatively, you can see $a$ as a matrix, so the function is $a:(x c^t)= \text{tr}(a (x c^t)^t)=\text{tr}(a c x^t)$ and the derivative is $ac$.

If you have to see $a$ as a vector if dimension $mn$, the derivative you seek $dz/dx=\left(\begin{array}{ccc}c^t & 0 & ... & 0\\0 & c^t & ... &0 \\ ... & ... & ... &...\\ 0 & 0 & ...& c^t\end{array}\right)$.

0
On

The function can be written as $$ \phi= \mathbf{a}:\mathrm{vec}(\mathbf{c}\mathbf{x}^T) $$ where the colon operator denotes the Frobenius inner product.

It holds $$ \phi= \mathrm{unvec}(\mathbf{a}): \mathbf{c}\mathbf{x}^T $$ and the gradient writes $\mathrm{unvec}(\mathbf{a})^T \mathbf{c}$.