class_docstr: Copy generator criterion.
class_docstr_tok: ["Copy","generator","criterion","."]
code: def __init__(
      self,
      vocab_size,
      force_copy,
      unk_index=0,
      ignore_index=-100,
      eps=1e-20,
  ):
      super(CopyGeneratorLoss, self).__init__()
      self.force_copy = force_copy
      self.eps = eps
      self.vocab_size = vocab_size
      self.ignore_index = ignore_index
      self.unk_index = unk_index
  
file_path: OpenNMT-py/onmt/modules/copy_generator.py
imports: import torch
  import torch.nn
label_desc: Use image node_id 1 to create a new CopyGeneratorLoss object from inherited base classes: nn with example: obj = CopyGeneratorLoss(vocab_size, force_copy, unk_index, ignore_index, eps)