Created
December 26, 2019 18:18
-
-
Save himanshurawlani/421742f462625235945934c613488cc9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Uncomment the below line if you're using dense layers | |
# x = tf.keras.layers.GlobalMaxPooling2D()(x) | |
# Fully connected layer 1 | |
# x = tf.keras.layers.Dropout(dropout_rate)(x) | |
# x = tf.keras.layers.BatchNormalization()(x) | |
# x = tf.keras.layers.Dense(units=64)(x) | |
# x = tf.keras.layers.Activation('relu')(x) | |
# Fully connected layer 1 | |
x = tf.keras.layers.Conv2D(filters=64, kernel_size=1, strides=1)(x) | |
x = tf.keras.layers.Dropout(dropout_rate)(x) | |
x = tf.keras.layers.BatchNormalization()(x) | |
x = tf.keras.layers.Activation('relu')(x) | |
# Fully connected layer 2 | |
# x = tf.keras.layers.Dropout(dropout_rate)(x) | |
# x = tf.keras.layers.BatchNormalization()(x) | |
# x = tf.keras.layers.Dense(units=len_classes)(x) | |
# predictions = tf.keras.layers.Activation('softmax')(x) | |
# Fully connected layer 2 | |
x = tf.keras.layers.Conv2D(filters=len_classes, kernel_size=1, strides=1)(x) | |
x = tf.keras.layers.Dropout(dropout_rate)(x) | |
x = tf.keras.layers.BatchNormalization()(x) | |
x = tf.keras.layers.GlobalMaxPooling2D()(x) | |
predictions = tf.keras.layers.Activation('softmax')(x) | |
model = tf.keras.Model(inputs=input, outputs=predictions) | |
print(model.summary()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment