after some checking, the weighing terms (1-p)^gamma and p^gamma are back propagated as well. you can refer to:
https://github.com/zimenglan-sysu-512/paper-note/blob/master/focal_loss.pdf 874

  
      
      GitHub
  
  
    

unsky/focal-loss 371

focal-loss - Focal loss for Dense Object Detection