help with defining neural networks

1 回表示 (過去 30 日間)
Radians
Radians 2020 年 2 月 10 日
コメント済み: Radians 2020 年 2 月 19 日
Hi,
When I define the following layers:
decodingLayers_2=[ ...
createUpsampleTransponseConvLayer(2,8), ...
reluLayer, ...
convolution2dLayer(3,1,'Padding','same'), ...
clippedReluLayer(1.0), ...
%clippedReluLayer(1.0), ...
regressionLayer];
Matlab gives the following error:
Error using vertcat
Dimensions of arrays being concatenated are not consistent.
But when I modify the above just a bit as follows:
decodingLayers_2=[ ...
createUpsampleTransponseConvLayer(2,8), ...
reluLayer, ...
convolution2dLayer(3,1,'Padding','same'), ...
clippedReluLayer(1.0), ...
clippedReluLayer(1.0), ...
regressionLayer];
The error disappears.
Please let me know why is this happening and why do I need to put 2 relu layers at the end when I just need 1.
thanks

採用された回答

Jyothis Gireesh
Jyothis Gireesh 2020 年 2 月 13 日
This error message may be due to the presence of a comment inside the “decodingLayers_2” array. This may interfere with the line continuation operator and eventually lead to an error during run-time.
One way to avoid this is to avoid commenting inside the array definition. So, the updated code can be as follows
decodingLayers_2 = [ ...
createUpsampleTransponseConvLayer(2,8), ...
reluLayer, ...
convolution2dLayer(3,1,'Padding','same'), ...
clippedReluLayer(1.0), ...
regressionLayer];
  1 件のコメント
Radians
Radians 2020 年 2 月 19 日
thanks, solved the problem for me.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSequence and Numeric Feature Data Workflows についてさらに検索

タグ

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by