class_docstr: DML_CSR loss for face parsing.
  
  Put more focus on facial components like eyes, eyebrow, nose and mouth
class_docstr_tok: ["DML_CSR","loss","for","face","parsing",".","Put","more","focus","on","facial","components","like","eyes",",","eyebrow",",","nose","and","mouth"]
code: def __init__(
      self,
      loss_weight=[1.0, 1.0, 1.0, 1.0, 1.0],
      ignore_index=255,
      lambda_1=1,
      lambda_2=1,
      lambda_3=1,
      num_classes=11,
  ):
      super(Criterion, self).__init__()
      self.ignore_index = ignore_index
      self.loss_weight = loss_weight
      self.criterion = torch.nn.CrossEntropyLoss(
          ignore_index=ignore_index
      )
      self.criterion_weight = torch.nn.CrossEntropyLoss(
          reduction="none", ignore_index=ignore_index
      )
      # self.sed = WeightedCrossEntropyWithLogits()
      self.lovasz = LovaszSoftmax(ignore_index=ignore_index)
      self.kldiv = KLDivergenceLoss(ignore_index=ignore_index)
      self.reg = ConsistencyLoss(ignore_index=ignore_index)
      self.lamda_1 = lambda_1
      self.lamda_2 = lambda_2
      self.lamda_3 = lambda_3
      self.num_classes = num_classes
  
file_path: insightface/parsing/dml_csr/loss/criterion.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import torch.nn
  import torch
  import numpy
  from torch.nn import functional
  from torch.nn.modules.loss import _Loss
  from .lovasz_softmax import LovaszSoftmax
  from .kl_loss import KLDivergenceLoss
  from .consistency_loss import ConsistencyLoss
label_desc: Use image node_id 1 to create a new Criterion object from inherited base classes: nn with example: obj = Criterion(loss_weight, ignore_index, lambda_1, lambda_2, lambda_3, num_classes)