Custom flattenLayer compatible with imageInputLayer

2 ビュー (過去 30 日間)
Amelia Moseley
Amelia Moseley 2020 年 9 月 19 日
回答済み: Dan 2022 年 9 月 8 日
I have been reading through some papers as part of research for my BSc major project, and came across this paper https://www.ijeat.org/wp-content/uploads/papers/v8i6/F8602088619.pdf outlining a hybrid LSTM-CNN architecture. While not the main subject of my project, I am curious about implementing the basic diagram that they have listed.
The architecture is simple enough: image input, batch normalization, lstm, convolution, max pool, fully connected, output.
Obviously a flatten layer is needed between batch norm and lstm, however the flatten layer provided in matlab is not compatible with image input layers (both 2D and 3D).
Reading the Flatten.m source file, the comments list the basic details of image dimensions, however the FlattenLayer.m (class) and flattenLayer.m (function), only list sequence data dimensions in their comments.
This makes me wonder if it is at all possible to make a custom flatten layer that is compatible with image input.

採用された回答

Madhav Thakker
Madhav Thakker 2020 年 9 月 23 日
Hi Amelia, I understand that you want to use flatten layer with Image input layer. As of now, faltten layer supports sequence input only. This exhancement is being taken into consideration and the concerned parties may be investigating further.
You can always define your own custom deep learning layers if required. https://www.mathworks.com/help/deeplearning/ug/define-custom-deep-learning-layers.html
Hope this helps.
  1 件のコメント
Shino Asada
Shino Asada 2021 年 3 月 29 日
I have a simple CNN network that uses FlattenLayer, which prevents me from porting the network to MATLAB to run. If MATLAB implements ReshapeLayer, I believe this will reduce a lot of trouble.

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

その他の回答 (1 件)

Dan
Dan 2022 年 9 月 8 日
same ask. it will be very beneficial from compatability with other frameworks

カテゴリ

Help Center および File ExchangeDeep Learning Toolbox についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by