code: def __init__(
      self, size: int, padding_idx: int, smoothing: float = 0.0
  ):
      super().__init__()
      self.loss = nn.KLDivLoss(reduction="sum")
      self.padding_idx = padding_idx
      self.confidence = 1.0 - smoothing
      self.smoothing = smoothing
      self.size = size
      self.true_dist = None
  
file_path: annotated_deep_learning_paper_implementations/labml_nn/transformers/label_smoothing_loss.py
imports: import matplotlib.pyplot
  import numpy
  import torch
  import torch.nn
  from labml_helpers.module import Module
label_desc: Use image node_id 1 to create a new LabelSmoothingLoss object from inherited base classes: Module with example: obj = LabelSmoothingLoss(size, padding_idx, smoothing)