How to choose $\gamma$ parameter in Focal Loss? I would like to know if exists a rule of thumb to set the $\gamma$ parameter in Focal Loss when we have very imbalanced classes.
The focal loss first appeared in Focal Loss for Dense Object Detection by Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, Piotr Dollár

On page 3, the authors write "we found $\gamma = 2$ to work best in our experiments." This tells us that they chose $\gamma$ experimentally by training models with different values and then choosing the $\gamma$ from the best model. Because this value was chosen experimentally, it may not be the best choice across all modeling tasks or datasets.
You might use $\gamma =2$, with the reasoning that the paper authors found that to be the best value. Alternatively, you can tune $\gamma$ experimentally (assuming you have the resources to do so).
