Created
July 9, 2021 15:19
-
-
Save Akash-Rawat/b835ee3ab0733ae3b4f654f4d5ed4d96 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(64, (5, 5), input_shape=image_size, activation='relu', padding='same')) | |
classifier.add(MaxPooling2D(pool_size = (2, 2))) | |
classifier.add(Conv2D(128, (3, 3), 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