Last active
February 7, 2021 22:28
-
-
Save maxrohleder/27e804d66eb0f54f0fcf4b06d957ea45 to your computer and use it in GitHub Desktop.
Three different approaches to design a model in keras.
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
from tensorflow.keras import layers, models | |
# define the model | |
model = models.Sequential(name="Keras Test CNN") | |
model.add(layers.Conv2D(32, (3, 3), activation='relu', input_shape=(28, 28, 1))) | |
model.add(layers.MaxPooling2D((2, 2))) | |
model.add(layers.Conv2D(64, (3, 3), activation='relu')) | |
model.add(layers.MaxPooling2D((2, 2))) | |
model.add(layers.Conv2D(64, (3, 3), activation='relu')) | |
model.add(layers.Flatten()) | |
model.add(layers.Dense(64, activation='relu')) | |
model.add(layers.Dense(10)) | |
# lets inspect our model so far | |
model.summary() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment