How to express this expression in a compact way?

41 Views Asked by At

it is my second question. I have the following expression:

$\sum_{i=1}^{N} \sum_{j=1}^{K} a_i^j X_i^T X_i b_j$

Where matrix $a$ has dimensions $n*k$, matrix $X$ is $n*d$ and matrix $b$ is $d*k$; the result should have dimensionality $d*1$.

I only obtain:

$\sum_{j=1}^{K} X^T S_j(a) X b_j$,

With $S_j(a)$ is a diagonal matrix generated from the $j$-th column of matrix $a$ and has dimensions $n*n$.

I want to know if there is a more compact (or elegant) expression. I tried combining $a,X,b$ but I am unable to find it.

Thanks!!

Mark