class_docstr: AsymmetricFocalTverskyLoss is a variant of FocalTverskyLoss, which attentions to the foreground class.
  
  Actually, it's only supported for binary image segmentation now.
  
  Reimplementation of the Asymmetric Focal Tversky Loss described in:
  
  - "Unified Focal Loss: Generalising Dice and Cross Entropy-based Losses to Handle Class Imbalanced Medical Image Segmentation",
  Michael Yeung, Computerized Medical Imaging and Graphics
class_docstr_tok: ["AsymmetricFocalTverskyLoss","is","a","variant","of","FocalTverskyLoss",",","which","attentions","to","the","foreground","class",".","Actually",",","it","'s","only","supported","for","binary","image","segmentation","now",".","Reimplementation","of","the","Asymmetric","Focal","Tversky","Loss","described","in",":","-","``","Unified","Focal","Loss",":","Generalising","Dice","and","Cross","Entropy-based","Losses","to","Handle","Class","Imbalanced","Medical","Image","Segmentation","''",",","Michael","Yeung",",","Computerized","Medical","Imaging","and","Graphics"]
docstr: Args:
      to_onehot_y: whether to convert `y` into the one-hot format. Defaults to False.
      delta : weight of the background. Defaults to 0.7.
      gamma : value of the exponent gamma in the definition of the Focal loss  . Defaults to 0.75.
      epsilon : it defines a very small number each time. simmily smooth value. Defaults to 1e-7.
docstr_tok: ["Args",":","to_onehot_y",":","whether","to","convert","`","y","`","into","the","one-hot","format",".","Defaults","to","False",".","delta",":","weight","of","the","background",".","Defaults","to","0.7.","gamma",":","value","of","the","exponent","gamma","in","the","definition","of","the","Focal","loss",".","Defaults","to","0.75.","epsilon",":","it","defines","a","very","small","number","each","time",".","simmily","smooth","value",".","Defaults","to","1e-7","."]
code: def __init__(
      self,
      to_onehot_y: bool = False,
      delta: float = 0.7,
      gamma: float = 0.75,
      epsilon: float = 1e-7,
      reduction: LossReduction | str = LossReduction.MEAN,
  ) -> None:
      """
      Args:
          to_onehot_y: whether to convert `y` into the one-hot format. Defaults to False.
          delta : weight of the background. Defaults to 0.7.
          gamma : value of the exponent gamma in the definition of the Focal loss  . Defaults to 0.75.
          epsilon : it defines a very small number each time. simmily smooth value. Defaults to 1e-7.
      """
      super().__init__(reduction=LossReduction(reduction).value)
      self.to_onehot_y = to_onehot_y
      self.delta = delta
      self.gamma = gamma
      self.epsilon = epsilon
  
file_path: MONAI/monai/losses/unified_focal_loss.py
imports: from __future__ import annotations
  import warnings
  import torch
  from torch.nn.modules.loss import _Loss
  from monai.networks import one_hot
  from monai.utils import LossReduction
label_desc: Use image node_id 1 to create a new AsymmetricFocalTverskyLoss object from inherited base classes: _Loss with example: obj = AsymmetricFocalTverskyLoss(to_onehot_y, delta, gamma, epsilon, reduction)