class_docstr: With set frequency, replaces tokens with unknown token.
  
  This layer can be used right before an embedding layer to make the model more robust
  to unknown words at test time.
docstr: Initialize layer.
  
  :param unknown_idx: index of unknown token, replace tokens with this
  :param probability: during training, replaces tokens with unknown token
                      at this rate.
docstr_tok: ["Initialize","layer",".",":","param","unknown_idx",":","index","of","unknown","token",",","replace","tokens","with","this",":","param","probability",":","during","training",",","replaces","tokens","with","unknown","token","at","this","rate","."]
code: def __init__(self, unknown_idx, probability):
      """
      Initialize layer.
  
      :param unknown_idx: index of unknown token, replace tokens with this
      :param probability: during training, replaces tokens with unknown token
                          at this rate.
      """
      super().__init__()
      self.unknown_idx = unknown_idx
      self.prob = probability
  
imports: import math
  import torch
  import torch.nn
  from torch.nn.parameter import Parameter
  from torch.nn.utils.rnn import pad_packed_sequence, pack_padded_sequence
  import torch.nn.functional
  from parlai.utils.torch import neginf
  from parlai.core.torch_generator_agent import TorchGeneratorModel
label_desc: Use image node_id 1 to create a new UnknownDropout object from inherited base classes: nn with example: obj = UnknownDropout(unknown_idx, probability)