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

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).
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
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.
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.)
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
Write a neural network in python for multiclass classification of an imbalanced dataset that makes a...
Write a neural network in python for multiclass classification of an imbalanced dataset that makes a successful model that both trains and evaluates the model and prints the Accuracy, Precision, Recall, and F1 score. Data will be in the form of a CSV file with 600,000 samples (or rows in the CSV) of 15 classes (for y_train and y_test) and 78 input dimensions/features. The imbalance will have some classes that have a low of only 8 samples taken. Your job...
Write a program that accepts a string and character as input, then counts and displays the...
Write a program that accepts a string and character as input, then counts and displays the number of times that character appears (in upper- or lowercase) in the string. Use C++ Enter a string: mallet Enter a character: a "A" appears 1 time(s) Enter a string: Racecar Enter a character: R "R" appears 2 time(s)
short essay describe how a neural network function. include the " use it or lose it"...
short essay describe how a neural network function. include the " use it or lose it" concept and the description of how individual cells work to transmit information. 2) you are driving a car. describe the functions of the various parts of your nervous system, including brain structures, are performing. include at least ten parts of the nervous system in your description.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT