pyannote / pyannote-metrics

A toolkit for reproducible evaluation, diagnostic, and error analysis of speaker diarization systems
http://pyannote.github.io/pyannote-metrics
MIT License
184 stars 32 forks source link

Avoid divide by zero error when computing cross entropy #14

Closed wq2012 closed 7 years ago

wq2012 commented 7 years ago

Suggest: In DiarizationHomogeneity.compute_components(), change matrix = reference.support() * hypothesis.support() to matrix = reference.support() * hypothesis.support() + 1e-8

hbredin commented 7 years ago

Could you please provide me with a simple Python script to reproduce the error you get?

wq2012 commented 7 years ago

Sorry I forgot what was my example. But it's worth adding tests for DiarizationHomogeneity.

And in general, for entropy, p * ln( p ) should return 0 when p == 0, rather than computing ln( 0 ) and raise error.

hbredin commented 7 years ago

Next release will contain a fix for this bug. Thanks for reporting it!