class_docstr: The implement of focal loss.
  
  The focal loss requires the label is 0 or 1 for now.
  
  Args:
      alpha (float, list, optional): The alpha of focal loss. alpha is the weight
          of class 1, 1-alpha is the weight of class 0. Default: 0.25
      gamma (float, optional): The gamma of Focal Loss. Default: 2.0
      ignore_index (int64, optional): Specifies a target value that is ignored
          and does not contribute to the input gradient. Default ``255``.
class_docstr_tok: ["The","implement","of","focal","loss",".","The","focal","loss","requires","the","label","is","0","or","1","for","now",".","Args",":","alpha","(","float",",","list",",","optional",")",":","The","alpha","of","focal","loss",".","alpha","is","the","weight","of","class","1",",","1-alpha","is","the","weight","of","class","0",".","Default",":","0.25","gamma","(","float",",","optional",")",":","The","gamma","of","Focal","Loss",".","Default",":","2.0","ignore_index","(","int64",",","optional",")",":","Specifies","a","target","value","that","is","ignored","and","does","not","contribute","to","the","input","gradient",".","Default","``","255","``","."]
code: def __init__(self, alpha=0.25, gamma=2.0, ignore_index=255):
      super().__init__()
      self.alpha = alpha
      self.gamma = gamma
      self.ignore_index = ignore_index
      self.EPS = 1e-10
  
file_path: PaddleSeg/paddleseg/models/losses/focal_loss.py
imports: import numpy
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddleseg.cvlibs import manager
label_desc: Use image node_id 1 to create a new FocalLoss object from inherited base classes: nn with example: obj = FocalLoss(alpha, gamma, ignore_index)