Take the 2-minute tour ×  I designed a kernel function (to be
used within SVM) which has the expression $tr(AB)$ in it. For
efficient implementation of this, I was wondering if I could
write $tr(AB)$ as an inner product: $\phi(A)^T \phi(B)$? What is
the function $\phi()$?  share|improve this question I'm not sure
I understand your question (it would help if you eliminated or
explained your jargon), but the obvious optimization is that you
don't explicitly need to compute AB: tr(AB) is the sum of
A_{ij}*B_{ji} over all pairs i,j. You can do this with a single
pass over your matrices. –  Darsh Ranjan Jan 14 '10 at 9:25
@darsh you beat me by 3 minutes! I can explain some of the
terminology. Imagine you have data in $\mathbb{R}^d$ (here it
seems to be in $\mathbb{R}^{d\times d}$??) but want to work with
it in $\mathbb{R}^D$, which you can accomplish by passing
everything through a mapping $\Phi$. If $D \gg d$, this can be
expensive. But in some cases your algorithm need only compute
inner products $\langle \Phi(a