Created
February 3, 2021 00:14
-
-
Save kumarvipu1/aad9e2e68a6e92c882fc126b5282bc39 to your computer and use it in GitHub Desktop.
image_classifier part 2
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
# importing the libraries | |
import tensorflow.keras.layers as layers | |
from tensorflow.keras.models import Model | |
from tensorflow.keras.models import Sequential | |
from tensorflow.keras.layers import Conv2D, MaxPool2D, Dense, Flatten | |
#defining function for building the model | |
def create_model(input_shape = (28,28,1)): | |
model = keras.Sequential([ | |
layers.Conv2D(filters = 32, kernel_size = 3, activation = 'relu', padding = 'same', input_shape = input_shape), | |
layers.MaxPool2D(pool_size = 2), | |
layers.Conv2D(filters = 64, kernel_size = 3, activation = 'relu', padding = 'same'), | |
layers.MaxPool2D(pool_size = 2), | |
layers.Conv2D(filters = 128, kernel_size = 3, activation = 'relu', padding = 'same'), | |
layers.MaxPool2D(pool_size = 2), | |
layers.Flatten(), | |
layers.Dense(units = 54, activation = 'relu'), | |
layers.Dense(units = 10, activation = 'softmax')]) | |
return model |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment