Skip to content

Examples of playing with Circle Loss from the paper "Circle Loss: A Unified Perspective of Pair Similarity Optimization", CVPR 2020.

Notifications You must be signed in to change notification settings

mklee1089/circleloss.pytorch

 
 

Repository files navigation

circleloss.pytorch

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.

Example 1: Visualization (learned features)

>>> python example_vis.py

This will visualize the learned features using t-SNE.

Example 2: Classification

Training w/o circle loss

>>> 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.

Training w/ circle 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.

Example 3: Comparison

>>> python example_compare.py

This will judge whether two digits are the same.

Acknowledgements

Thanks the implementation TinyZeaMays/CircleLoss and the authors of the paper.

About

Examples of playing with Circle Loss from the paper "Circle Loss: A Unified Perspective of Pair Similarity Optimization", CVPR 2020.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%