Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os, sys
- sys.path.append(os.path.join(os.getcwd(), "keras-deep-graph-learning")) # Adding the submodule to the module search path
- sys.path.append(os.path.join(os.getcwd(), "keras-deep-graph-learning/examples")) # Adding the submodule to the module search path
- import numpy as np
- from examples import utils
- from keras.layers import Dense, Activation, Dropout
- from keras.models import Model, Sequential
- from keras.regularizers import l2
- from keras.optimizers import Adam
- from keras_dgl.layers import GraphCNN
- import keras.backend as K
- X, A, Y = utils.load_data(dataset='cora')
- print("Just to check that this is indeed sparse, but not zero, check the column sums: ", sum(A.A))
- y_train, y_val, y_test, idx_train, idx_val, idx_test, train_mask = utils.get_splits(Y)
- A_norm = utils.preprocess_adj_numpy(A, True)
- # for reference, what do we do with preprocessing?
- #
- # adj = adj + np.eye(adj.shape[0])
- # d = np.diag(np.power(np.array(adj.sum(1)), -0.5).flatten(), 0)
- # a_norm = adj.dot(d).transpose().dot(d)
- # return a_norm
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement