class_docstr: Class for dropping out embeddings by zero'ing out parameters in the
  embedding matrix.
  
  This is equivalent to dropping out particular words, e.g., in the sentence
  'the quick brown fox jumps over the lazy dog', dropping out 'the' would
  lead to the sentence '### quick brown fox jumps over ### lazy dog' (in the
  embedding vector space).
  
  See 'A Theoretically Grounded Application of Dropout in Recurrent Neural
  Networks', (Gal and Ghahramani, 2016).
class_docstr_tok: ["Class","for","dropping","out","embeddings","by","zero'ing","out","parameters","in","the","embedding","matrix",".","This","is","equivalent","to","dropping","out","particular","words",",","e.g.",",","in","the","sentence","'the","quick","brown","fox","jumps","over","the","lazy","dog","'",",","dropping","out","'the","'","would","lead","to","the","sentence","'","#","#","#","quick","brown","fox","jumps","over","#","#","#","lazy","dog","'","(","in","the","embedding","vector","space",")",".","See","'","A","Theoretically","Grounded","Application","of","Dropout","in","Recurrent","Neural","Networks","'",",","(","Gal","and","Ghahramani",",","2016",")","."]
docstr: Embedding constructor.
  
  Args:
      dropout: Dropout probability.
      scale: Used to scale parameters of embedding weight matrix that are
          not dropped out. Note that this is _in addition_ to the
          `1/(1 - dropout)` scaling.
  
  See `torch.nn.Embedding` for remaining arguments.
docstr_tok: ["Embedding","constructor",".","Args",":","dropout",":","Dropout","probability",".","scale",":","Used","to","scale","parameters","of","embedding","weight","matrix","that","are","not","dropped","out",".","Note","that","this","is","_in","addition_","to","the","`","1\/","(","1","-","dropout",")","`","scaling",".","See","`","torch.nn.Embedding","`","for","remaining","arguments","."]
code: def __init__(
      self,
      num_embeddings,
      embedding_dim,
      max_norm=None,
      norm_type=2,
      scale_grad_by_freq=False,
      sparse=False,
      dropout=0.1,
      scale=None,
  ):
      """Embedding constructor.
  
      Args:
          dropout: Dropout probability.
          scale: Used to scale parameters of embedding weight matrix that are
              not dropped out. Note that this is _in addition_ to the
              `1/(1 - dropout)` scaling.
  
      See `torch.nn.Embedding` for remaining arguments.
      """
      torch.nn.Embedding.__init__(
          self,
          num_embeddings=num_embeddings,
          embedding_dim=embedding_dim,
          max_norm=max_norm,
          norm_type=norm_type,
          scale_grad_by_freq=scale_grad_by_freq,
          sparse=sparse,
      )
      self.dropout = dropout
      assert (dropout >= 0.0) and (dropout < 1.0), (
          "Dropout must be >= 0.0 " "and < 1.0"
      )
      self.scale = scale
  
imports: import numpy
  import collections
  import torch
  from torch import nn
  import torch.nn.functional
  from torch.autograd import Variable
  import models.shared_base
  import utils
label_desc: Use image node_id 1 to create a new EmbeddingDropout object from inherited base classes: torch.nn with example: obj = EmbeddingDropout(num_embeddings, embedding_dim, max_norm, norm_type, scale_grad_by_freq, sparse, dropout, scale)