CNN error using deep network designer

4 ビュー (過去 30 日間)
Teo
Teo 2021 年 9 月 21 日
編集済み: Teo 2021 年 10 月 2 日
Hi,
i trying to combine certain part of the two CNN into one model using addition layer. However, there seem to be error while analyzing the combined models using deep network designer.
Thank you.

採用された回答

Katja Mogalle
Katja Mogalle 2021 年 9 月 22 日
Hi Teo,
As you already noticed, the shufflenet branch results in 544 channels and the resnet18 branch results in 512 channels. You could map one of those branches (e.g. shufflenet branch) to the number of filters of the other branch (e.g. resnet18) by using a convolution2dLayer with filter size [1 1] and 512 filters. Then you should be able to do the addition.
I don't know the details of what you're doing and what the two branches are supposed to do, but I wonder if a concatenationLayer would be the better choice here to combine the two branches.
I hope this helps.
Katja
  3 件のコメント
Katja Mogalle
Katja Mogalle 2021 年 9 月 23 日
編集済み: Katja Mogalle 2021 年 9 月 23 日
The activations of the layers in your network are four-dimensional: Height-by-Width-by-NumChannels-by-MiniBatchSize. To configure the layer, you need to tell it over which of those dimensions you want to concatenate. In your case, you want to combine the channels of the inputs. The channels are in the third dimension of the activations. So in this scenario, Dim would be 3.
The layer basically executes MATLAB's cat function. If you're interested in more details, the examples shown in the cat reference page might provide a better understanding of the concatenation operation. The example with the 3D array is closest to what happens in the convolutional neural network.
Teo
Teo 2021 年 9 月 23 日
I really appreciate your suggestion and clarification on the confusion. Thank you very much.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with Deep Learning Toolbox についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by