HarryVolek / PyTorch_Speaker_Verification

PyTorch implementation of "Generalized End-to-End Loss for Speaker Verification" by Wan, Li et al.
BSD 3-Clause "New" or "Revised" License
575 stars 165 forks source link

Possible bug report and suggestion on how to fix it. #54

Open hash2430 opened 4 years ago

hash2430 commented 4 years ago

I think you need to change utils.get_cossim() line 42 as follows from if speaker_num == centroid_num: to if (speaker_num == centroid_num) and (hp.training):

because you do not want to recalculate centroid from evaluation embeddings at the test time. Wouldn't it be appropriate to use centroids that are calculated solely from enrollment embeddings?

Maybe my understanding on the paper and code is insufficient and I might be missing something. Let me know if I am wrong about this.

Of course it works without fixing it but in my understanding in strict sense, that centroid recalculation is only required for stabilizing training steps.