フィルターのクリア

Max Pooling Layer Tuning

2 ビュー (過去 30 日間)
Jahetbe
Jahetbe 2023 年 9 月 1 日
コメント済み: Jahetbe 2023 年 9 月 2 日
Hello,
I'm currently working on implementing a CNN for a regression problem, and I've encountered an issue when using the maxPooling2dLayer with a poolSize greater than 1. Here's the relevant part of my code:
Layers = [imageInputLayer([NIV 1 1])
convolution2dLayer(5, 15, 'Padding', 'same')
batchNormalizationLayer
reluLayer
maxPooling2dLayer(2) % (poolSize > 1 leads to an error!!!)
reluLayer
dropoutLayer(0.5)
fullyConnectedLayer(1)
regressionLayer];
The problem arises when I try to set the poolSize in the maxPooling2dLayer to a value greater than 1. I receive the following errors:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Error using trainNetwork (line 183)
Invalid network.
Error in CNN (line 280)
net = trainNetwork(XTrain, YTrain, Layers, Options);
Caused by:
Layer 5: Input size mismatch. Size of input to this layer is different from the expected input size.
Inputs to this layer:
from layer 4 (output size 6×1×15)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
I'm seeking assistance to resolve this issue. Any guidance or suggestions you could provide would be greatly appreciated.
Thank you!
  2 件のコメント
Matt J
Matt J 2023 年 9 月 1 日
NIV is missing.
Jahetbe
Jahetbe 2023 年 9 月 1 日
NIV is the 6

サインインしてコメントする。

採用された回答

Matt J
Matt J 2023 年 9 月 1 日
Your input image's spatial dimensions are 6x1. This is not compatible with a 2x2 maxpooling filter. Did you mean to have 2x1 pooling instead? If so,
maxPooling2dLayer([2,1])
  3 件のコメント
Matt J
Matt J 2023 年 9 月 2 日
I'm glad, but please Accept-click the answer to indicate so.
Jahetbe
Jahetbe 2023 年 9 月 2 日
Done.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Data Workflows についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by