Can anyone explain how to do concatenation of flatten outputs from CNN with the outputs from DNN?

2 ビュー (過去 30 日間)
I have defined two layers
1 CNN_Layer which takes input size of 12*25*1 and implment successive Con2D filters, MaxPooling ,etc and finally flatten the inputs from the final layer.
2 DNN_Layer which takes input size of 4*1 and ouput the same as the input(Just takes raw input and give us the raw input without changing it) .
My goal is to concatenat the faltten outputs from CNN_Layers and the outputs from DNN_Layers for further training using FCC layers.
The output from CNN_Layer after flatten is dim 864, so I expact 868 after concatenation .
Is there any way we can do that in matlab?
I know how to do that in Python.
combined_model= concatenate([CNN_Layers.output, DNN_Layers.output])
  1 件のコメント
Poorya Khanali
Poorya Khanali 2021 年 2 月 18 日
Hi, could you find any solution to your problem? This is exactly the problem that I am currently facing? Any help would be appreciated.

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

回答 (1 件)

Mohammad Sami
Mohammad Sami 2020 年 7 月 23 日
Try using the concatenation Layer, introduced since R2019a.
https://www.mathworks.com/help/releases/R2020a/deeplearning/ref/nnet.cnn.layer.concatenationlayer.html
  1 件のコメント
Wabi Demeke
Wabi Demeke 2020 年 8 月 1 日
This is multiple inputs(input1 dim(12*25*1) & Input 2 dim(1*4*1)) problem. The data need to be combined before it feed into and I don't want that at the beginning( https://www.mathworks.com/help/deeplearning/ug/multiple-input-and-multiple-output-networks.html#mw_4f57107d-31b4-4432-8d4f-2065ce9008f0). I beleive concatenationlayer/depthconcatenationlayer works as long as the input layer takes input1 or input2.

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

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by