hyperconnect / LADE

This repository contains code for the paper "Disentangling Label Distribution for Long-tailed Visual Recognition", published at CVPR' 2021
https://arxiv.org/abs/2012.00321
Other
96 stars 11 forks source link

LADE loss implementation #13

Closed aiexperience closed 2 years ago

aiexperience commented 2 years ago

Hi, I got another question from the issues12# but it's a slightly different question, so I opened one more.

My question is the meaning of the 'PerformanceLoss' and 'RouteWeightLoss' in the code. Is it a sort of classification between training phase loss and inference (evaluate) phase loss?

For example, to apply the LADE loss we need loss/PriorCELoss.py and loss/LADELoss.py. My understanding is at the training phase, the code said PerformanceLoss (Maybe PriorCELoss) will be applied. At the inference phase, RouteWeightLoss (Maybe LADELoss) will be applied. Is it right?

Code location: https://github.com/hyperconnect/LADE/blob/150181e/config/CIFAR100_LT/lade.yaml#L2-L11

juice500ml commented 2 years ago

We were closely following the implementation of Causal norm, where they implement classification loss (PerformanceLoss) and its regularizer (RouteWeightLoss) like that.

Our implementation has a bit of a misnomer. Currently LADELoss.py implements "LADER (eq. 16 in the paper)" and PriorCELoss.py implements "LADE-CE (eq. 18-19 in the paper). Hence, the linear combination of the two ("LADE (eq. 20)") is the final loss, which is implemented here.

Hence, both losses are applied in training!