clovaai / voxceleb_trainer

In defence of metric learning for speaker recognition
MIT License
1.02k stars 272 forks source link

why use negtive as positive in triplet loss #113

Closed WilliamZhaoz closed 3 years ago

WilliamZhaoz commented 3 years ago

Hi, thanks for your great work, I have a question In triplet.py, why do you treat all negtive as positve and hard negtive as negtive ? (

out_anchor = F.normalize(x[:, 0, :], p=2, dim=1)
out_positive = F.normalize(x[:, 1, :], p=2, dim=1) 
...
out_negative = out_positive[negidx, :] 

)

is it right? why it can work?

thanks