Advertisement
Guest User

Untitled

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