Handle NaN embeddings in speaker diarization. (#1461)
See also https://github.com/thewh1teagle/sherpa-rs/issues/33
This commit is contained in:
@@ -122,7 +122,7 @@ class SpeakerEmbeddingExtractorNeMoImpl : public SpeakerEmbeddingExtractorImpl {
|
||||
auto variance = EX2 - EX.array().pow(2);
|
||||
auto stddev = variance.array().sqrt();
|
||||
|
||||
m = (m.rowwise() - EX).array().rowwise() / stddev.array();
|
||||
m = (m.rowwise() - EX).array().rowwise() / (stddev.array() + 1e-5);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user