ShadeAlsha / LTR-weight-balancing

CVPR 2022 - official implementation for "Long-Tailed Recognition via Weight Balancing" https://arxiv.org/abs/2203.14197
MIT License
118 stars 10 forks source link

Questions about Maxnorm regularizations #5

Open chenbinghui1 opened 2 years ago

chenbinghui1 commented 2 years ago

In paper, it claims that Maxnorm regularization is applied per iteration, but in the code, it seems to be applied per epoch? Am i right?

ShadeAlsha commented 2 years ago

In the demo, MaxNorm is applied in each epoch as you said. This corresponds to lines 140-142 in trainval.py.

https://github.com/ShadeAlsha/LTR-weight-balancing/blob/0e9494cad5b4805642f05097a336096f780300ee/utils/trainval.py#L140-L142

You can move this code up in order to apply it per-iteration as in the paper. I will update the shared open-source code soon. Thank you!

rahulvigneswaran commented 2 years ago

Looks like there is a significant difference in performance between the two. Resnet34. Benchmarked with the code provided.

Screenshot 2022-07-01 at 9 35 29 AM

@ShadeAlsha @chenbinghui1

ShadeAlsha commented 2 years ago

Yes, PGD is supposed to be applied in each iteration as in page 4 of the paper and as chenbinghui1 mentioned earlier :) I haven't updated the code yet, but in the mean time your modified version should be good if you just moved PGD to the iteration loop. Thanks for your interest!

xiaohe6 commented 1 year ago

Hello, I would like to ask, when I used the author's source code to fine-tune, how is it that the addition and removal of maximum regularization are the same? Does it seem to not work?