Skip to content
Implementation of "Anchor Loss: Modulating loss scale based on prediction difficulty"
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE.txt license Oct 21, 2019 Update Nov 1, 2019 logpt_neg correction Nov 22, 2019

Anchor Loss in PyTorch

PyTorch implementation of Anchor Loss: Modulating loss scale based on prediction difficulty, Serim Ryou, Seong-Gyun Jeong, Pietro Perona, ICCV 2019

Anchor Loss

anchorloss This code provides anchor loss on image classification. To train the model with anchor loss, include and call the AnchorLoss() function.

from anchor_loss import AnchorLoss

gamma = 0.5
slack = 0.05
anchor = 'neg'
warm_up = False

criterion = AnchorLoss(gamma, slack, anchor, warm_up)

The default parameter settings are shown above. Details about the parameters are explained in the

If you use this code, please cite it:

  author = {Ryou, Serim and Jeong, Seong-Gyun and Perona, Pietro},
  title = {Anchor Loss: Modulating Loss Scale Based on Prediction Difficulty},
  booktitle = {The IEEE International Conference on Computer Vision (ICCV)},
  month = {October},
  year = {2019}
You can’t perform that action at this time.