A Pytorch implementation of triplet loss on VoxCeleb1
Using softmax pre-training to initialise the network.
triplets selector: semi-hard
Full length utterances are used in testing. So we can fed into network just one example everytime. But if using multi-GPUs(e.g. 6), you can input 6 examples for each iteration.
embedding_dim=256:
- | EER | m-DCF |
---|---|---|
triplet loss | 7.22 | 0.639 |
-
Create virtual environment:
conda create -n vox_triplet_loss python=3.7 conda activate vox_triplet_loss
-
Install
pytorch
: https://pytorch.org/get-started/locally/ -
Pretrain:
- Change the
train_mode
to‘pretrain’
inconstants.py
- Set GPU configuration, data_path and save_path in your computer
- Run the
train.py
- Change the
-
Use triplet loss to train model:
- Change the
train_mode
to‘triplet’
inconstants.py
- Change the
https://github.com/davidsandberg/facenet