How to create a custom multi input layer for sequence model

9 ビュー (過去 30 日間)
Gawsalyan Sivapalan
Gawsalyan Sivapalan 2019 年 4 月 16 日
コメント済み: Van Vy 2021 年 10 月 22 日
I want to develop similsr type of architechture and Matlab does not support 2 input sequence to one model. Hence could you please let me know some perfect example of deveoping custom layer for inputs like this.
Capture.JPG
I have also tried to develop the same model in keras and try to import. But it is not helpful as well.
pasted image 0.png
Please help and Thanks in Advance
  2 件のコメント
Maryam Khairunissa
Maryam Khairunissa 2021 年 5 月 27 日
hi,
have you solved this issue? I have similar case but for 3 sequence input layers.
Gawsalyan Sivapalan
Gawsalyan Sivapalan 2021 年 5 月 27 日
Hi,
Unfortuntely I coudn't get help from MATLAB teams. I tried editing a custom layer but it didn't get accepted by the MLToolbox as it was keep throwing error saying mismatch in size for backpropagation (You can try it as well). Therefore, I developbed my own ML toolbox in matlab for the purpose. https://github.com/gawsalyan/FloatingPoint-NN-from-scratch-MATLAB
Please feel free to contribute to the code base if possible or let me know of any errors as it is solely developed by myself. If you need a fixedpoint version, you can look into my github for the same.
It is very similar to how you create layers in original MATLAB ML Toolbox.
Hope this will help.
P.S.: - Unfortunately I have developed and tested only few layers LSTM and MLP mainly. Only SGD for learning is used.
Cheers!
Siva

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

採用された回答

Kenta
Kenta 2020 年 3 月 29 日
As of 2019b, a new system called "custom training loop" which enables you to implement multi-input CNN is available.
For example, you can refer to the example below.
As of 2019a, to implement multi-input CNN is not easy. If you can update the version of Matlab, please try the example below.
  1 件のコメント
Van Vy
Van Vy 2021 年 10 月 22 日
Could you please explain more about the connect layer? If I have 3 inputs, how can I fix the layers? I have trouble with 3 inputs and connectLayers() function. it shows input 1 and input 3 only. Here is my code:
layers2=renameLayer(layers2,'_2');
layersRemoved=[layers(1:end);concatenationLayer(1,3,'Name','cat')];
lgraphAggregated = addLayers(layerGraph(layersRemoved),layers2(1:end));
lgraphAggregated = connectLayers(lgraphAggregated,'fc_2','cat/in2');
layers3=renameLayer(layers3,'_3');
layersRemoved1=[layers2(1:end);concatenationLayer(1,3,'Name','cat')];
lgraphAggregated = addLayers(layerGraph(layersRemoved),layers3(1:end));
lgraphAggregated = connectLayers(lgraphAggregated,'fc_3','cat/in3');

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB Coder についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by