class_docstr:     ## Generator Loss
  
      Generator should **descend** on the gradient,
  
      $$
  abla_{  heta_g} rac{1}{m} \sum_{i=1}^m \Bigg[
          \log \Big(1 - D\Big(G\Big(\pmb{z}^{(i)}\Big)\Big)\Big)
      \Bigg]$$
      
code: def __init__(self, smoothing: float = 0.2):
      super().__init__()
      self.loss_true = nn.BCEWithLogitsLoss()
      self.smoothing = smoothing
      # We use labels equal to $1$ for $\pmb{x}$ from $p_{G}.$
      # Then descending on this loss is the same as descending on
      # the above gradient.
      self.register_buffer(
          "fake_labels",
          _create_labels(256, 1.0 - smoothing, 1.0),
          False,
      )
  
file_path: annotated_deep_learning_paper_implementations/labml_nn/gan/original/__init__.py
imports: import torch
  import torch.nn
  import torch.utils.data
  import torch.utils.data
  from labml_helpers.module import Module
label_desc: Use image node_id 1 to create a new GeneratorLogitsLoss object from inherited base classes: Module with example: obj = GeneratorLogitsLoss(smoothing)