Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Build an convolutional neural network,the function should return model with the following specifications: First Convolutional Layer: Uses 6 filters with a kernel size of 5
Build an convolutional neural network,the function should return model with the following specifications:
First Convolutional Layer: Uses filters with a kernel size of x 'relu' activation and x pixels, grayscale as input images size.
First Pooling Layer: Uses max pooling with a pool size of x and a stride of
Second Convolutional Layer: Uses filters with a kernel size of x and 'relu' activation.
Second Pooling Layer: Uses max pooling with the same specifications as the first pooling layer.
Flattening Layer: Converts the feature map to a D array.
First Dense Layer: Has units with 'relu' activation.
Second Dense Layer: Has units with 'relu' activation.
Third Dense Layer: Has units with 'softmax' activation.
The network should be compiled using Adam optimizer, categoricalcrossentropy loss function and accuracy as a metric. from warnings import filters
import keras
from keras.models import Sequential
from keras.layers import ConvD MaxPoolingD Flatten, Dense
from tensorflow import keras
# Function : Build the model
def createmodel:
output: A compile CNN model with the specifications listed in the question
### BEGIN SOLUTION
return model
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started