SHARE
TWEET

Untitled

a guest Jun 25th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. model = Sequential()
  2. model.add(Conv2D(filters=32, kernel_size=(3,3),padding='SAME', input_shape=X[0].shape))
  3.  
  4. model.add(Activation('relu'))
  5. model.add(MaxPooling2D(pool_size=(2,2), dim_ordering='th'))
  6.  
  7. model.add(Conv2D(filters=64, kernel_size=(3,3), padding='SAME'))
  8. model.add(Activation('relu'))
  9. model.add(MaxPooling2D(pool_size=(2,2), dim_ordering='th'))
  10. model.add(Dropout(rate=0.4))
  11.  
  12. model.add(Conv2D(filters=128, kernel_size=(3,3), padding='SAME'))
  13. model.add(Activation('relu'))
  14. model.add(MaxPooling2D(pool_size=(2,2), dim_ordering='th'))
  15. model.add(Dropout(rate=0.35))
  16.  
  17. #model.add(Conv2D(filters=64, kernel_size=(3,3), padding='SAME'))
  18. #model.add(Activation('relu'))
  19. #model.add(MaxPooling2D(pool_size=(2,2), dim_ordering='th'))
  20.  
  21. model.add(Flatten())
  22. model.add(Dense(1024))
  23. model.add(Activation('relu'))
  24. model.add(Dropout(rate=0.3))
  25.  
  26. model.add(Dense(2))
  27. model.add(Activation('softmax'))
  28.      
  29. opt = keras.optimizers.SGD(lr=0.0001, decay=0.0)
  30. model.compile(optimizer=opt, loss='binary_crossentropy', metrics['accuracy'])
  31. print(model.summary())
  32.  
  33. model.fit(X, np.array(Y), validation_data=(test_x, np.array(test_y)), epochs=30, verbose=2)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top