xiao-he / HSIC

Hilbert-schmidt independence criteria
10 stars 1 forks source link

HSIC formulation #1

Closed ylee0716 closed 5 years ago

ylee0716 commented 5 years ago

Hello, I have read your code about HSIC, thanks for your help! But I found the formulation about HSIC is HSIC=(m-1)^(-2)tr(HKHL) in original paper, and your code use np.sum(KHLH) rather than np.trace(HKHL). I want to know why you write that. Looking forword to your reply!

xiao-he commented 5 years ago

Hi, tr(KL) = np.sum(K.*L). In the code it is element wise multiplication.

xiao-he commented 5 years ago

And the reason is that np.sum() seems to be a bit faster.

ylee0716 commented 5 years ago

Thank you very much!