#KL_divergence = nan

1 messages · Page 1 of 1 (latest)

bold light
#

Hi, i have two distributions type Bernoulli, but the KL-divergence is equal to nan. Do you have any idea ?

grand finch
# bold light Hi, i have two distributions type Bernoulli, but the KL-divergence is equal to n...

Referring here https://stackoverflow.com/questions/59736801/why-do-i-get-a-nan-when-computing-the-kl-divergence-between-two-onehotcategorica - it might be because of log(0) or the 0/0 operation? Have you tried adding a small epsilon to see if you can get a different output?

bold light
#

I can add a small epsilon to y but not to the distribtuion

#

thats where i'm stuck