Skip to content

Repository files navigation

Metric learning models in PyTorch, recall@1

CUB2011CARS196Stanford Online Products
Margin contrastive loss, semi-hard0.58 @ epoch600.80 @ epoch600.7526 @ epoch90
Lifted structured embedding
Triplet loss

Original impl published at: https://github.com/apache/incubator-mxnet/blob/master/example/gluon/embedding_learning/model.py

Examples

# evaluation results are saved in ./data/log.txt# train margin contrastive loss on CUB2011 using ResNet-50
python train.py --dataset cub2011 --model margin --base resnet50
# download GoogLeNet weights and train using LiftedStruct loss
wget -P ./data https://github.com/vadimkantorov/metriclearningbench/releases/download/data/googlenet.h5
python train.py --dataset cub2011 --model liftedstruct --base inception_v1_googlenet
# evaluate raw final layer embeddings on CUB2011 using ResNet-50
python train.py --dataset cub2011 --model untrained --epochs 1

About

Metric learning models in PyTorch with results on CUB2011, CARS196, Stanford Online Products

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages