class_docstr: GraphFactory
code: def __init__(self, args):
      self.args = args
      self.adj_matrix = weight_matrix(self.args.adj_mat_file)
  
      L = np.eye(self.adj_matrix.shape[0]) + self.adj_matrix
      D = np.sum(self.adj_matrix, axis=1)
      #  L = D - self.adj_matrix
      #  import ipdb; ipdb.set_trace()
  
      edges = []
      weights = []
      for i in range(self.adj_matrix.shape[0]):
          for j in range(self.adj_matrix.shape[1]):
              edges.append([i, j])
              weights.append(L[i][j])
  
      self.edges = np.array(edges, dtype=np.int64)
      self.weights = np.array(weights, dtype=np.float32).reshape(-1, 1)
  
      self.norm = np.zeros_like(D, dtype=np.float32)
      self.norm[D > 0] = np.power(D[D > 0], -0.5)
      self.norm = self.norm.reshape(-1, 1)
  
file_path: PGL/legacy/examples/stgcn/data_loader/graph.py
imports: import sys
  import os
  import numpy
  import pandas
  from pgl.graph import Graph
label_desc: Use image node_id 1 to create a new GraphFactory object from inherited base classes: object with example: obj = GraphFactory(args)