Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- train_on_weight= np.array([1,1,0])
- print("Now we won't do any fancy preprocessing, just basic training.")
- NUM_FILTERS = 1
- graph_conv_filters = A # you may try np.eye(3)
- graph_conv_filters = K.constant(graph_conv_filters)
- model = Sequential()
- model.add(GraphCNN(Y.shape[1], NUM_FILTERS, graph_conv_filters, input_shape=(X.shape[1],), activation='elu', kernel_regularizer=l2(5e-4)))
- model.add(Activation('softmax'))
- model.compile(loss='categorical_crossentropy', optimizer=Adam(lr=0.01), metrics=['acc'])
- model.summary()
- model.fit(X, Y, batch_size=A.shape[0], sample_weight=train_on_weight, epochs=200, shuffle=False, verbose=0)
- Y_pred = model.predict(X, batch_size=A.shape[0])
- print(np.argmax(Y_pred, axis=1))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement