Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- classifier = Sequential()
- # Step 1 - Convolution
- classifier.add(Convolution2D(32, 3, 3, input_shape = (64, 64, 3), activation = 'relu'))
- # Step 2 - Pooling
- classifier.add(MaxPooling2D(pool_size = (2, 2)))
- # Adding a second convolutional layer
- classifier.add(Convolution2D(32, 3, 3, activation = 'relu'))
- classifier.add(MaxPooling2D(pool_size = (2, 2)))
- # Step 3 - Flattening
- classifier.add(Flatten())
- # Step 4 - Full connection
- classifier.add(Dense(output_dim = 128, activation = 'relu'))
- classifier.add(Dense(output_dim = 1, activation = 'sigmoid'))
- # Compiling the CNN
- classifier.compile(optimizer = 'adam', loss = 'binary_crossentropy', metrics = ['accuracy'])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement