class_docstr: Focal loss for multi-class problem. It uses softmax to compute focal term instead of sigmoid as in
  original paper. This loss expects target labes to have one dimension less (like in nn.CrossEntropyLoss).
class_docstr_tok: ["Focal","loss","for","multi-class","problem",".","It","uses","softmax","to","compute","focal","term","instead","of","sigmoid","as","in","original","paper",".","This","loss","expects","target","labes","to","have","one","dimension","less","(","like","in","nn.CrossEntropyLoss",")","."]
docstr: :param alpha:
  :param gamma:
  :param ignore_index: If not None, targets with given index are ignored
  :param reduced_threshold: A threshold factor for computing reduced focal loss
docstr_tok: [":","param","alpha",":",":","param","gamma",":",":","param","ignore_index",":","If","not","None",",","targets","with","given","index","are","ignored",":","param","reduced_threshold",":","A","threshold","factor","for","computing","reduced","focal","loss"]
code: def __init__(
      self,
      gamma: float = 2.0,
      reduction: str = "mean",
      normalized: bool = False,
      reduced_threshold: Optional[float] = None,
      ignore_index: int = -100,
  ):
      """
  
      :param alpha:
      :param gamma:
      :param ignore_index: If not None, targets with given index are ignored
      :param reduced_threshold: A threshold factor for computing reduced focal loss
      """
      super().__init__()
      self.gamma = gamma
      self.reduction = reduction
      self.reduced_threshold = reduced_threshold
      self.normalized = normalized
      self.ignore_index = ignore_index
  
file_path: pytorch-toolbelt/pytorch_toolbelt/losses/focal.py
imports: from functools import partial
  from typing import Optional
  import torch
  from torch import Tensor, nn
  from torch.nn.modules.loss import _Loss
  from .functional import focal_loss_with_logits, softmax_focal_loss_with_logits
  from pytorch_toolbelt.utils import pytorch_toolbelt_deprecated
label_desc: Use image node_id 1 to create a new CrossEntropyFocalLoss object from inherited base classes: nn with example: obj = CrossEntropyFocalLoss(gamma, reduction, normalized, reduced_threshold, ignore_index)