Question

In: Computer Science

Consider a Convolutional Neural Network which accepts a 120 x 120 CMYK image as input. The...

Consider a Convolutional Neural Network which accepts a 120 x 120 CMYK image as input.
The network has a series of 5 convolutional layers, where the parameters in conv-layer 3 and
conv-layer 5 are shared. Each conv-layer has 20 3x3 filters. The output of the last conv-layer is
flattened and passed through a fully connected layer with 30 neurons, which is then passed
through another fully connected layer of 10 neurons. Each neuron in the fully connected layers
and each filter in the conv-layers also have a scalar bias associated with them, which are also
trainable parameters. Calculate the total number of trainable parameters in the network. Show
your calculation.

Solutions

Expert Solution

Solution

Calculating the parameters without dropouts:

The input_1(Input Layer) has shape (None,120,120,1) and parameter is 0. In the whole program stride=1,kernel_size=3*3,padding=same and filters =20.

Convolutional_1 : ((kernel_size)*stride+1)*filters) = ((3*3)*1+1)*20 = 200 parameters. In first layer, the convolutional layer has 20 filters.

Convolutional_2 : As convolutional_1 already learned 20 filters. So the number of trainable parameters in this layer is ((3 * 3) * 20 + 1) * 20 = 3,620 and so on.

Max_pooling_2d_1: This layer is used to reduce the input image size. kernal_size = (3,3) used here. So input image 120 is reduced to half 60. And model learns nothing from this layer.

Convolutional_3 : ((3 * 3 * 20 + 1) * 40) = 7,240 and so on.

Convolutional_4 : similarly for this , it is ((3* 3 * 20 + 1) * 40) = 7,240 and so on.

Max_pooling_2d_2: This layer is used to reduce the input image size. kernal_size = (3,3) used here. So input image 60 is reduced to half 30. And model learns nothing from this layer.

Convolutional_5 : Finally in this layer, it is ((3* 3 * 20 + 1) * 80) = 14,480 and so on.

At last all parameters sum together.

Total Training Parameter =32,780

Trainable Parameters = 32,780

Non-Trainable Parameter = 0.

Hence the total number of parameters are 32,780

if you have any Queries Please comment below
if you like my answer please upvote / like it.
Thank you


Related Solutions

Subject: Neural network and Pattern recognition (Deep Learning) Given the following partial network definitioon: Input -...
Subject: Neural network and Pattern recognition (Deep Learning) Given the following partial network definitioon: Input - A 28 x 28 RGB image First Layer - 7, 5 x 5 filters. Activation function: Sigmoid Second Layer - 23, 3 x 3 filters. Activation function: RelU Third Layer - 20, 3 x 3 filters. Activation function: RelU You task is to do design(s) of the next part of the network (so that it uses the output of the third layer). The purpose...
write a fully-connected neural network to work with MNIST and Tensorflow 2.x. The labels will be...
write a fully-connected neural network to work with MNIST and Tensorflow 2.x. The labels will be input and MNIST image vectors as output labels. use tf.GradientTape instead fit. show the 28x28 image with the input vector. PLEASE WRITE CODE AND DO NOT SENT ME DIFFERENT PARTS TO A WEBSITE. It is clear, it's a homework assignment.  
Write a MATLAB function that accepts input vector x and returns the number of local maximums...
Write a MATLAB function that accepts input vector x and returns the number of local maximums of x with value between xmin and xmax. Ask user to input values xmin and xmax at the beginning of the procedure. Use vector x (the vector x from that file consists of 1000 numbers ranging from 0.0044 to 0.67).
Predictive Modeling Using Neural Networks (For SAS Enterprise Miner software) In preparation for a neural network...
Predictive Modeling Using Neural Networks (For SAS Enterprise Miner software) In preparation for a neural network model, is the imputation of missing values needed? Why or why not?
what does resent50 function do in neural network ?
what does resent50 function do in neural network ?
Python Using tkinter, create a GUI interface which accepts input of a GPA. If the GPA...
Python Using tkinter, create a GUI interface which accepts input of a GPA. If the GPA is >= 3.5, display 'Dean’s List' If the GPA is < 2.0, display 'Probation’ If the GPA is < 3.5 and >= 2.0, display 'Regular Standing' Run one test case for each case above and save the output.
Briefly assess the relationships between Biological and Artificial Neural Network
Briefly assess the relationships between Biological and Artificial Neural Network
Consider the problem of image blurring due to uniform acceleration in the x direction. If the...
Consider the problem of image blurring due to uniform acceleration in the x direction. If the image is at rest at position x_0 at time t = 0 and accelerates with a uniform acceleration a, then its position at time t = T is given by x = x_0 + (1/2) a(T)^2. Find the blurring function. (Assume that the shutter opening and closing times are negligible.)
Write an interactive Java class which accepts an input argument when the application is executed from...
Write an interactive Java class which accepts an input argument when the application is executed from the command-line. Accept input from the user and compare the value entered to the command-line argument value. If the strings do not equal, display "INVALID VALUE! TRY AGAIN!", otherwise display "PERMISSION GRANTED!" and exit the program.
Say that a neural network has been constructed to predict the creditworthiness of applicants. There are...
Say that a neural network has been constructed to predict the creditworthiness of applicants. There are two output nodes: one for yes (1 = yes, 0 = no) and one for no (1 = no, 0 = yes). An applicant receives a score of 0.83 for the “yes” output node and a 0.44 for the “no” output node. Discuss what may have happened and whether the applicant is a good credit risk. explain with your own words please
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT