#797 · Primary category: Education & Research

tensorflow-triplet-loss

embeddings online-triplet-mining tensorflow triplet-loss

Implementation of triplet loss in TensorFlow

Project last updated:05/09/19

GitHub Stars

1.1K

Forks

280

Contributors

4

License

MIT

Why we included this project

Metric learning is one of the trickier parts of deep learning to get right, and this repository is one of the clearer working references for it. The code implements triplet loss in TensorFlow with both batch-all and batch-hard online triplet mining, so you get the actual loss functions behind face recognition and person re-identification work instead of a hand-wavy outline. A detailed blog post and the associated CS230 material explain the sampling strategy, which matters more than the loss line itself when you are debugging embeddings. If you train embedding models and want a compact, tested implementation to compare against your own, this is a good place to start. Just know it is reference and teaching code, not a maintained package: expect to port the TensorFlow 1.x API to whatever you use today.

Articles for this project

No articles for this project yet.

To suggest a topic or contribute an article, contact us.

Related projects in this category