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 日間)
古いコメントを表示
Jyoti Nautiyal
2021 年 7 月 9 日
コメント済み: Jyoti Nautiyal
2021 年 7 月 16 日
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!