class_docstr: NeuralCFG From Kim et al
code: def __init__(self, V, T, NT, H):
      super().__init__()
      self.NT = NT
      self.V = V
      self.T = T
      self.word_emb = nn.Parameter(torch.Tensor(V, H))
      self.term_emb = nn.Parameter(torch.Tensor(T, H))
      self.nonterm_emb = nn.Parameter(torch.Tensor(NT, H))
      self.nonterm_emb_c = nn.Parameter(torch.Tensor(NT + T, NT + T, H))
      self.root_emb = nn.Parameter(torch.Tensor(NT, H))
      self.s_emb = nn.Parameter(torch.Tensor(1, H))
      self.mlp1 = Res(H)
      self.mlp2 = Res(H)
      for p in self.parameters():
          if p.dim() > 1:
              torch.nn.init.xavier_uniform_(p)
  
file_path: pytorch-struct/examples/networks/NeuralCFG.py
imports: import torch
  import torch.nn
label_desc: Use image node_id 1 to create a new NeuralCFG object from inherited base classes: torch.nn with example: obj = NeuralCFG(V, T, NT, H)