In a custom CNN network, how can I know about the input size for each layer?

조회 수: 9 (최근 30일)
debojit sharma
debojit sharma 2022년 6월 23일
댓글: debojit sharma 2022년 7월 2일
For preparing the type of table as shown in the above figure,how can I get values for the last column of the table i.e Input Size for each layer in my CNN model?

답변 (1개)

Image Analyst
Image Analyst 2022년 6월 23일
When you build a custom network, for example like this:
layers = [
imageInputLayer([227, 227, 3])
convolution2dLayer(3,8,'Padding','same')
batchNormalizationLayer
reluLayer
averagePooling2dLayer(2,'Stride',2)
convolution2dLayer(3,16,'Padding','same')
batchNormalizationLayer
reluLayer
averagePooling2dLayer(2,'Stride',2)
convolution2dLayer(3,32,'Padding','same')
batchNormalizationLayer
reluLayer
convolution2dLayer(3,32,'Padding','same')
batchNormalizationLayer
reluLayer
dropoutLayer(0.2)
fullyConnectedLayer(1)
regressionLayer];
the 227 is not something you "get". It's something you specify. Bigger images take longer to train but will be more accurate. If your accuracy is low, try increasing the size of images you supply.
If you're doing transfer learning, like adapting alexnet or googlenet, then you need to know what image sizes they want and make sure you supply images of that size.
  댓글 수: 4
debojit sharma
debojit sharma 2022년 7월 1일
please tell me what will be the input size and output size of each layers in the following model.
layers = [
imageInputLayer([227, 227, 3])
convolution2dLayer(3,8,'Padding','same')
batchNormalizationLayer
reluLayer
averagePooling2dLayer(2,'Stride',2)
convolution2dLayer(3,16,'Padding','same')
batchNormalizationLayer
reluLayer
averagePooling2dLayer(2,'Stride',2)
convolution2dLayer(3,32,'Padding','same')
batchNormalizationLayer
reluLayer
convolution2dLayer(3,32,'Padding','same')
batchNormalizationLayer
reluLayer
flattenLayer('Name','flatten')
dropoutLayer(0.2)
lstmLayer(300,'OutputMode','last','Name','lstm')
fullyConnectedLayer(8)
softmaxLayer
classificationLayer];
debojit sharma
debojit sharma 2022년 7월 2일
If i take my above example, is it so that output size of the lstmLayer is equal to the number of hidden units used in the lstmLayer?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Image Data Workflows에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by