Why number of filters, numF = round(16/sqrt(SectionDepth)) and why numF is doubled in each convolution in Deep Learning Using Bayesian Optimization in MATLAB Documentation?
1 次查看(过去 30 天)
显示 更早的评论
imageSize = [32 32 3];
numClasses = numel(unique(YTrain));
numF = round(16/sqrt(optVars.SectionDepth));
layers = [
imageInputLayer(imageSize)
% The spatial input and output sizes of these convolutional
% layers are 32-by-32, and the following max pooling layer
% reduces this to 16-by-16.
convBlock(3,numF,optVars.SectionDepth)
maxPooling2dLayer(3,'Stride',2,'Padding','same')
% The spatial input and output sizes of these convolutional
% layers are 16-by-16, and the following max pooling layer
% reduces this to 8-by-8.
convBlock(3,2*numF,optVars.SectionDepth)
maxPooling2dLayer(3,'Stride',2,'Padding','same')
% The spatial input and output sizes of these convolutional
% layers are 8-by-8. The global average pooling layer averages
% over the 8-by-8 inputs, giving an output of size
% 1-by-1-by-4*initialNumFilters. With a global average
% pooling layer, the final classification output is only
% sensitive to the total amount of each feature present in the
% input image, but insensitive to the spatial positions of the
% features.
convBlock(3,4*numF,optVars.SectionDepth)
averagePooling2dLayer(8)
% Add the fully connected layer and the final softmax and
% classification layers.
fullyConnectedLayer(numClasses)
softmaxLayer
classificationLayer];
0 个评论
采纳的回答
Sripranav Mannepalli
2021-7-13
Hi,
The number of filters (numF) are proportional to 1/sqrt(SectionDepth), so that the networks of different depths have roughly the same number of parameters and require about the same amount of computation per iteration.
Further, each time the spatial dimensions are down-sampled by a factor of two using max pooling layers, the number of filters (numF) are doubled to ensure that the amount of computation required in each convolutional layer is roughly the same.
For more information, refer to the "Define the convolutional neural network architecture" subsection in the Deep Learning Using Bayesian Optimization.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Data Workflows 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!