code: def __init__(self, vocab, hidden_size, embedding=None):
      super(JTNNEncoderBO, self).__init__()
      self.hidden_size = hidden_size
      self.vocab_size = vocab.size()
      self.vocab = vocab
  
      if embedding is None:
          self.embedding = nn.Embedding(self.vocab_size, hidden_size)
      else:
          self.embedding = embedding
  
      self.W_z = nn.Linear(2 * hidden_size, hidden_size)
      self.W_r = nn.Linear(hidden_size, hidden_size, bias=False)
      self.U_r = nn.Linear(hidden_size, hidden_size)
      self.W_h = nn.Linear(2 * hidden_size, hidden_size)
      self.W = nn.Linear(2 * hidden_size, hidden_size)
  
file_path: DIG/dig/ggraph/method/JTVAE/fast_jtnn/jtnn_enc_bo.py
imports: import torch
  import torch.nn
  from collections import deque
  from .nnutils import create_var, GRU
label_desc: Use image node_id 1 to create a new JTNNEncoderBO object from inherited base classes: nn with example: obj = JTNNEncoderBO(vocab, hidden_size, embedding)