Commit f85aa929 authored by gleb.sternharz's avatar gleb.sternharz

fix dev by 0 in KL-Divergence

parent 05b9c991
......@@ -741,7 +741,7 @@ struct KL_Divergence
Iterator1 last = a + size;
while (a < last) {
if (* a != 0) {
if (* b != 0) {
ResultType ratio = (ResultType)(*a / *b);
if (ratio>0) {
result += *a * log(ratio);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment