Skip to content

Instantly share code, notes, and snippets.

Created June 7, 2019 15:01
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
print("this filter includes the edges, so it should perform considerably better than before.:")
graph_conv_filters = A_norm
graph_conv_filters = K.constant(graph_conv_filters)
num_filters = 1
model = Sequential()
model.add(GraphCNN(Y.shape[1], num_filters, graph_conv_filters, input_shape=(X.shape[1],), activation='elu',
model.compile(loss='categorical_crossentropy', optimizer=Adam(lr=0.01), metrics=['acc'])
nb_epochs = 100
for epoch in range(nb_epochs):, y_train, sample_weight=train_mask, batch_size=A.shape[0], epochs=1, shuffle=False, verbose=0)
Y_pred = model.predict(X, batch_size=A.shape[0])
_, train_acc = utils.evaluate_preds(Y_pred, [y_train], [idx_train])
_, test_acc = utils.evaluate_preds(Y_pred, [y_test], [idx_test])
print("Epoch: {:04d}".format(epoch), "train_acc= {:.4f}".format(train_acc[0]), "test_acc= {:.4f}".format(test_acc[0]))
# Epoch: 0017 train_acc= 1.0000 test_acc= 0.6950
# Epoch: 0099 train_acc= 1.0000 test_acc= 0.7600
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment