Why is it necessary to have multiple filters for a convolution layer in a CNN?

4 views (last 30 days)
I have a convolution layer in my CNN. For example, say the filter size is 2x2 and the stride is 2. There are 12 filters. What are the weights for the filters? How do they learn different features and activations? In order to get each filter to learn different weights, do I need to initialize the weights of each filter to different starting values? 

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 4 Mar 2021
Edited: MathWorks Support Team on 4 Mar 2021
The "trainNetwork" function in MATLAB will learn different weights for each filter, so that each filter learns different features. Although you can initialize each filter, this is not necessary as this will only be the starting point for the network training.
When you do transfer learning on a pre-trained network such as AlexNet, the initial weights before transfer learning are the weights that AlexNet learned during its training.
If you are training from scratch, you can initialize the weights to be random values. See the "Specify Initial Weight and Biases in Convolutional Layer" example at this link:
 

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!