# Read the Adjacency matrix Adjacency_Matrix = pd.read_csv(DIR + 'Adjacency_Matrix.csv', header=None) Adjacency_Matrix = np.array(Adjacency_Matrix).astype('float32') Adjacency_Matrix = sparse.csr_matrix(Adjacency_Matrix) # This is the coarsen levels, you can definitely change the level to observe the difference graphs, perm = coarsening.coarsen(Adjacency_Matrix, levels=5, self_connections=False) X_train = coarsening.perm_data(train_data, perm) X_test = coarsening.perm_data(test_data, perm) # Obtain the Graph Laplacian L = [ graph.laplacian(Adjacency_Matrix, normalized=True) for Adjacency_Matrix in graphs ] # Hyper-parameters params = dict() params['dir_name'] = Model params['num_epochs'] = 100 params['batch_size'] = 1024 params['eval_frequency'] = 100 # Building blocks. params['filter'] = 'chebyshev5' params['brelu'] = 'b2relu' params['pool'] = 'mpool1'
os.mkdir(SAVE) # Load the dataset, here it uses one-hot representation for labels train_data, train_labels, test_data, test_labels = DatasetLoader(DIR=DIR) # Read the Adjacency matrix Adjacency_Matrix = pd.read_csv(DIR + 'Adjacency_Matrix.csv', header=None) Adjacency_Matrix = np.array(Adjacency_Matrix).astype('float32') Adjacency_Matrix = sparse.csr_matrix(Adjacency_Matrix) graphs, perm = coarsening.coarsen(Adjacency_Matrix, levels=5, self_connections=False) X_train = coarsening.perm_data(train_data, perm) X_test = coarsening.perm_data(test_data, perm) # Obtain the Graph Laplacian L = [graph.laplacian(Adjacency_Matrix, normalized=True) for Adjacency_Matrix in graphs] # Hyper-parameters params = dict() params['dir_name'] = Model params['num_epochs'] = 100 params['batch_size'] = 1024 params['eval_frequency'] = 100 # Building blocks. params['filter'] = 'chebyshev5' params['brelu'] = 'b2relu' params['pool'] = 'mpool1' # Architecture. params['F'] = [16, 32, 64, 128, 256, 512] # Number of graph convolutional filters.