Created
July 28, 2021 18:18
-
-
Save Akash-Rawat/3767ca0b5a43f533588124420b377946 to your computer and use it in GitHub Desktop.
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
def cnn(image_size, num_classes): | |
classifier = Sequential() | |
classifier.add(Conv2D(4, (3, 3), input_shape=image_size, activation='relu', padding='same')) | |
classifier.add(MaxPooling2D(pool_size = (2, 2))) | |
classifier.add(Conv2D(8, (2, 2), activation='relu', padding='same')) | |
classifier.add(MaxPooling2D(pool_size = (2, 2))) | |
classifier.add(Flatten()) | |
classifier.add(Dense(num_classes, activation = 'softmax')) | |
classifier.compile(optimizer='adam', loss='categorical_crossentropy', metrics=['acc']) | |
return classifier | |
neuralnetwork_cnn = cnn(image_size, num_classes) | |
neuralnetwork_cnn.summary() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment