marian icon indicating copy to clipboard operation
marian copied to clipboard

Why is the cross entropy calculated by marian-scorer negative?

Open zhangxinlu16 opened this issue 5 years ago • 4 comments

When I use marian-scorer to calculate cross-entropy for each sentence pair, why i get negative score for each sentence pair cross entropy?

zhangxinlu16 avatar Oct 22 '19 10:10 zhangxinlu16

log

kpu avatar Oct 22 '19 10:10 kpu

log

According to the definition of cross entropy, the result should be non-negative. Is marian-scorer's result a negative cross entropy?

zhangxinlu16 avatar Oct 22 '19 11:10 zhangxinlu16

Hi, The per-sentence score is just a sum of log probabilities, so technically a negative cross-entropy. Taking exp(score) you would get the total sentence probability in normal probability space between 0 and 1.

emjotde avatar Oct 22 '19 13:10 emjotde

Hi, The per-sentence score is just a sum of log probabilities, so technically a negative cross-entropy. Taking exp(score) you would get the total sentence probability in normal probability space between 0 and 1.

Thanks for your reply!

zhangxinlu16 avatar Oct 22 '19 13:10 zhangxinlu16