Skip to content

Instantly share code, notes, and snippets.

@martinetmayank
Created September 4, 2021 15:57
Show Gist options
  • Save martinetmayank/9e1a157519284a9bf0a5640d139576fa to your computer and use it in GitHub Desktop.
Save martinetmayank/9e1a157519284a9bf0a5640d139576fa to your computer and use it in GitHub Desktop.
Network
from keras import models
from keras import layers
model = models.Sequential()
model.add(layers.Conv2D(
filters=32,
kernel_size=(3, 3),
strides=(1, 1),
padding='valid',
activation='relu',
input_shape=(150, 150, 3)
))
model.add(layers.MaxPool2D((2, 2)))
model.add(layers.Conv2D(
filters=64,
kernel_size=(3, 3),
strides=(1, 1),
padding='valid',
activation='relu',
))
model.add(layers.MaxPool2D((2, 2)))
model.add(layers.Conv2D(
filters=128,
kernel_size=(3, 3),
strides=(1, 1),
padding='valid',
activation='relu',
))
model.add(layers.MaxPool2D((2, 2)))
model.add(layers.Conv2D(
filters=128,
kernel_size=(3, 3),
strides=(1, 1),
padding='valid',
activation='relu',
))
model.add(layers.MaxPool2D((2, 2)))
model.add(layers.Flatten())
model.add(layers.Dense(512, activation='relu'))
model.add(layers.Dense(1, activation='sigmoid'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment