Created
February 5, 2020 16:55
-
-
Save sihu/1b3e35e8c316affbbe8011934d58c9f0 to your computer and use it in GitHub Desktop.
Convolutions of GRF Model
This file contains 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
model = tf.keras.models.Sequential([ | |
# Note the input shape is the desired size of the image 150x150 with 3 bytes color | |
# This is the first convolution | |
tf.keras.layers.Conv2D(64, (3, 3), activation='relu', input_shape=(HEIGHT, WIDTH, 3)), | |
tf.keras.layers.MaxPooling2D(2, 2), | |
# The second convolution | |
tf.keras.layers.Conv2D(64, (3, 3), activation='relu'), | |
tf.keras.layers.MaxPooling2D(2, 2), | |
tf.keras.layers.Dropout(0.3), | |
# The third convolution | |
tf.keras.layers.Conv2D(64, (3, 3), activation='relu'), | |
tf.keras.layers.MaxPooling2D(2, 2), | |
tf.keras.layers.Dropout(0.2), | |
# The fourth convolution | |
tf.keras.layers.Conv2D(64, (3, 3), activation='relu'), | |
tf.keras.layers.MaxPooling2D(2, 2), | |
# Flatten the results to feed into a DNN | |
tf.keras.layers.Flatten(), | |
tf.keras.layers.Dropout(0.3), | |
# 512 neuron hidden layer | |
tf.keras.layers.Dense(512, activation='relu'), | |
tf.keras.layers.Dense(13, activation='softmax') | |
]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment