Skip to content

Instantly share code, notes, and snippets.

@dpoulopoulos
Created July 9, 2021 09:32
Show Gist options
  • Save dpoulopoulos/3e98d35c6d1bdd71031ab37ef3242ff2 to your computer and use it in GitHub Desktop.
Save dpoulopoulos/3e98d35c6d1bdd71031ab37ef3242ff2 to your computer and use it in GitHub Desktop.
input = layers.Input(input_shape)
x_1 = layers.Conv2D(32, kernel_size=(3, 3), activation="relu")(input)
x_1 = layers.MaxPooling2D(pool_size=(2, 2))(x_1)
x_1 = layers.Conv2D(64, kernel_size=(3, 3), activation="relu")(x_1)
x_1 = layers.MaxPooling2D(pool_size=(2, 2))(x_1)
x_1 = layers.Flatten()(x_1)
x_2 = layers.Conv2D(16, kernel_size=(3, 3), activation="relu")(input)
x_2 = layers.MaxPooling2D(pool_size=(2, 2))(x_2)
x_2 = layers.Conv2D(32, kernel_size=(7, 7), activation="relu")(x_2)
x_2 = layers.MaxPooling2D(pool_size=(2, 2))(x_2)
x_2 = layers.Flatten()(x_2)
x = layers.concatenate([x_1, x_2])
x = layers.Dropout(0.5)(x)
out = layers.Dense(num_classes, activation="softmax")(x)
model = keras.Model(input, out)
model.summary()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment