Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. classifier = Sequential()
  2.  
  3. # Step 1 - Convolution
  4. classifier.add(Convolution2D(32, 3, 3, input_shape = (64, 64, 3), activation = 'relu'))
  5.  
  6. # Step 2 - Pooling
  7. classifier.add(MaxPooling2D(pool_size = (2, 2)))
  8.  
  9. # Adding a second convolutional layer
  10. classifier.add(Convolution2D(32, 3, 3, activation = 'relu'))
  11. classifier.add(MaxPooling2D(pool_size = (2, 2)))
  12.  
  13. # Step 3 - Flattening
  14. classifier.add(Flatten())
  15.  
  16. # Step 4 - Full connection
  17. classifier.add(Dense(output_dim = 128, activation = 'relu'))
  18. classifier.add(Dense(output_dim = 1, activation = 'sigmoid'))
  19.  
  20. # Compiling the CNN
  21. classifier.compile(optimizer = 'adam', loss = 'binary_crossentropy', metrics = ['accuracy'])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement