docstr: :param index_nod_edg:
  :param num_edge_type, virtual type included
docstr_tok: [":","param","index_nod_edg",":",":","param","num_edge_type",",","virtual","type","included"]
code: def __init__(
      self,
      mask_node,
      mask_edge,
      index_select_edge,
      st_type="sigmoid",
      num_flow_layer=12,
      graph_size=38,
      num_node_type=9,
      num_edge_type=4,
      use_bn=True,
      num_rgcn_layer=3,
      nhid=128,
      nout=128,
  ):
      """
      :param index_nod_edg:
      :param num_edge_type, virtual type included
      """
      super(MaskedGraphAF, self).__init__()
      self.repeat_num = mask_node.size(0)
      self.graph_size = graph_size
      self.num_node_type = num_node_type
      self.num_edge_type = num_edge_type
  
      self.mask_node = nn.Parameter(
          mask_node.view(1, self.repeat_num, graph_size, 1),
          requires_grad=False,
      )  # (1, repeat_num, n, 1)
      self.mask_edge = nn.Parameter(
          mask_edge.view(1, self.repeat_num, 1, graph_size, graph_size),
          requires_grad=False,
      )  # (1, repeat_num, 1, n, n)
      self.index_select_edge = nn.Parameter(
          index_select_edge, requires_grad=False
      )  # (edge_step_length, 2)
  
      self.emb_size = nout
      self.num_flow_layer = num_flow_layer
  
      self.rgcn = RGCN(
          num_node_type,
          nhid=nhid,
          nout=nout,
          edge_dim=self.num_edge_type - 1,
          num_layers=num_rgcn_layer,
          dropout=0.0,
          normalization=False,
      )
  
      if use_bn:
          self.batchNorm = nn.BatchNorm1d(nout)
  
      self.st_type = st_type
      self.st_net_fn_dict = {
          "sigmoid": ST_Net_Sigmoid,
          "exp": ST_Net_Exp,
          "softplus": ST_Net_Softplus,
      }
      assert st_type in [
          "sigmoid",
          "exp",
          "softplus",
      ], "unsupported st_type, choices are [sigmoid, exp, softplus, ]"
      st_net_fn = self.st_net_fn_dict[st_type]
      self.node_st_net = nn.ModuleList(
          [
              st_net_fn(
                  nout, self.num_node_type, hid_dim=nhid, bias=True
              )
              for _ in range(num_flow_layer)
          ]
      )
      self.edge_st_net = nn.ModuleList(
          [
              st_net_fn(
                  nout * 3, self.num_edge_type, hid_dim=nhid, bias=True
              )
              for _ in range(num_flow_layer)
          ]
      )
  
file_path: DIG/dig/ggraph/method/GraphAF/model/graphaf.py
imports: import numpy
  import torch
  import torch.nn
  from .rgcn import *
  from .st_net import *
label_desc: Use image node_id 1 to create a new MaskedGraphAF object from inherited base classes: nn with example: obj = MaskedGraphAF(mask_node, mask_edge, index_select_edge, st_type, num_flow_layer, graph_size, num_node_type, num_edge_type, use_bn, num_rgcn_layer, nhid, nout)