class_docstr:     The general loss for ``Graph2Seq`` model.
  Parameters
  ----------
  ignore_index: ignore_index
      The token index which will be ignored during calculation. Usually it is the padding index.
  use_coverage: bool, default=False
      Whether use coverage mechanism. If set ``True``, the we will add the coverage loss.
  coverage_weight: float, default=0.3
      The weight of coverage loss.
code: def __init__(
      self, ignore_index, use_coverage=False, coverage_weight=0.3
  ):
      super(SeqGenerationLoss, self).__init__()
      self.use_coverage = use_coverage
      self.loss_ce = GeneralLoss(
          loss_type="NLL", reduction="mean", ignore_index=ignore_index
      )
      self.loss_coverage = CoverageLoss(cover_loss=coverage_weight)
  
imports: import torch
  from .base import GeneralLossBase
  from .coverage_loss import CoverageLoss
  from .general_loss import GeneralLoss
label_desc: Use image node_id 1 to create a new SeqGenerationLoss object from inherited base classes: GeneralLossBase with example: obj = SeqGenerationLoss(ignore_index, use_coverage, coverage_weight)