Guest User

Untitled

a guest
Nov 19th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. X_res, y_res, X_test, y_test = generate_train_test_sample(X, y)
  2.  
  3.  
  4. X_res = np.expand_dims(X_res, axis=0)
  5. print X_res.shape
  6.  
  7. seed(2017)
  8. conv = Sequential()
  9. conv.add(Conv1D(2, 2, input_shape=(29, 1), activation='relu'))
  10. conv.add(MaxPooling1D(2))
  11. conv.add(Flatten())
  12. conv.add(Dense(300, activation = 'relu'))
  13.  
  14. sgd = SGD(lr = 0.1, momentum = 0.9, decay = 0, nesterov = False)
  15. conv.compile(loss = 'binary_crossentropy', optimizer = sgd, metrics =['accuracy'])
  16. conv.fit(X_res, y_res, batch_size = 500, epochs = 15, verbose = 50)
Add Comment
Please, Sign In to add comment