Skip to content

Instantly share code, notes, and snippets.

@GeorgeSeif
Last active October 14, 2019 00:05
Show Gist options
  • Save GeorgeSeif/e46e8333b6da878c61839a441bf3c2de to your computer and use it in GitHub Desktop.
Save GeorgeSeif/e46e8333b6da878c61839a441bf3c2de to your computer and use it in GitHub Desktop.
IMG_SIZE = (28, 28, 1)
input_img = layers.Input(shape=IMG_SIZE)
model = layers.Conv2D(32, (3, 3), padding='same')(input_img)
model = layers.Activation('relu')(model)
model = layers.Conv2D(32, (3, 3), padding='same', strides=(2, 2))(model)
model = layers.Activation('relu')(model)
model = layers.Conv2D(64, (3, 3), padding='same')(model)
model = layers.Activation('relu')(model)
model = layers.Conv2D(64, (3, 3), padding='same', strides=(2, 2))(model)
model = layers.Activation('relu')(model)
model = layers.Conv2D(64, (3, 3), padding='same')(model)
model = layers.Activation('relu')(model)
model = layers.Conv2D(64, (3, 3), padding='same')(model)
model = layers.Activation('relu')(model)
model = layers.GlobalAveragePooling2D()(model)
model = layers.Dense(32)(model)
model = layers.Activation('relu')(model)
model = layers.Dense(10)(model)
output_img = layers.Activation('softmax')(model)
model = models.Model(input_img, output_img)
model.summary()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment