Examples of playing with Circle Loss from the paper "Circle Loss: A Unified Perspective of Pair Similarity Optimization", CVPR 2020.
The implementation of Circle Loss is from TinyZeaMays/CircleLoss.
>>> python example_vis.py
This will visualize the learned features using t-SNE.
>>> python example_cls_wo_circleloss.py
[1/40] Training classifier.
Test set: Accuracy: 5348/10000 (53%)
...
[40/40] Training classifier.
Test set: Accuracy: 9863/10000 (99%)
This will train a simple neural network under the cross entropy loss.
>>> python example_cls.py
[1/20] Training with Circle Loss.
...
[20/20] Training with Circle Loss.
[1/20] Training classifier. Test set: Accuracy: 9682/10000 (97%)
...
[20/20] Training classifier. Test set: Accuracy: 9888/10000 (99%)
This will train a simple neural network under the circle loss firstly, and then train a classifier under the cross entropy loss using the extracted features.
>>> python example_compare.py
This will judge whether two digits are the same.
Thanks the implementation TinyZeaMays/CircleLoss and the authors of the paper.