The conv layer in CNN uses different filters for activation maps but if all the weghits are same for all filters the feature maps of all filters will be same so whats the use of having more than one filter ?

2 views (last 30 days)
Suppose if i have a image size of 36 * 36 * 1 and i use a filter of 2*2 and stride 2 and 12 number of filters but what are the weights for the filters like if the first filter has all ones the second should have a different value third should have a different so that we get different activation maps but if all the filters are same we don`t have any distinct features since all are same. So, how do we do that in Matlab like how can we initialise each filter with weights or is this pre configured something like that.

Answers (1)

Renee Coetsee
Renee Coetsee on 13 Apr 2017
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 totally necessary because this will only be the starting point for the network training.
When you do transfer learning on a pretrained 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:

Categories

Find more on Image Data Workflows in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!