KL Divergence

6 views
Skip to first unread message

Haifeng GONG

unread,
May 19, 2010, 6:14:08 PM5/19/10
to MathTools
function v = kldivergence(hp, hq)

v = sum(hp.* log( (hp+1e-6)./(hq+1e-6) ) );
if v<0
v=0;
end

--
You received this message because you are subscribed to the Google Groups "MathTools" group.
To post to this group, send email to math...@googlegroups.com.
To unsubscribe from this group, send email to mathtools+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mathtools?hl=en.

Reply all
Reply to author
Forward
0 new messages