Is it possible to combine two neural networks in MATLAB?

53 ビュー (過去 30 日間)
Isa El Doori
Isa El Doori 2018 年 11 月 1 日
コメント済み: Yogini Prabhu 2020 年 12 月 18 日
Hi,
For my assignment I have been looking into the possibility to combine two neural networks into one by element-wise summation of certain layers.
Much like this:
I know that this can be implemented in python, but what I was wondering was if it is also possible to implement it in MATLAB? If yes, how? I have looked into the parfor function to train multiple neural networks in parallel, however I have not found a way to then combine the layers of these networks.
Thanks in advance!

回答 (2 件)

Bernhard Suhm
Bernhard Suhm 2018 年 11 月 9 日
MATLAB has an AdditionLayer that allows you to combine outputs of two separate strands in your deep learning network. With R2018b, you can use the Deep Learning Designer app to graphically layout complex layer architectures like the one you allude to above. You need the Deep Learning toolbox though.
  2 件のコメント
Isa El Doori
Isa El Doori 2018 年 11 月 14 日
Hi Bernhard,
Thank you for your reply! I have designed (most) part of the layer architecture. The AdditionLayer really came in handy. Thanks!
Yogini Prabhu
Yogini Prabhu 2020 年 12 月 18 日
Hi Bernanrd,
can the Adiition layer be used , if we have two diffrent datasets to be utilised for 2 different NN (classification type) and decision be made on results of both,eg if one has got defect in eye (retina dataset and iris dataset)

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


Shounak Mitra
Shounak Mitra 2018 年 11 月 11 日
Hi Isa,
If I understand your question correctly, you want to train 2 neural networks simultaneously and then combine them into one through an element wise operation of the layers. You're not looking to merge two branches of the same network. Is my understanding correct? I'll reach out to you to learn more about your use-case.
By Looking at the workflow diagram, I am wondering if you're trying to use an encoder-decoder network for a semnatic segmentation task? If that's true, then learn more here --> https://www.mathworks.com/help/vision/examples/semantic-segmentation-using-deep-learning.html
If you're looking for combining two branches of a neural network using an element-wise operation, then we've 2 ways in which you can do that. 1. Depth Concatenation layer : https://www.mathworks.com/help/deeplearning/ref/nnet.cnn.layer.depthconcatenationlayer.html
2. Addition layer (as mentioned by Bernhard): https://www.mathworks.com/help/deeplearning/ref/nnet.cnn.layer.additionlayer.html?searchHighlight=addition%20layer&s_tid=doc_srchtitle
  2 件のコメント
Isa El Doori
Isa El Doori 2018 年 11 月 14 日
Hi Shounak,
Thank you for your comment! Please see the reply I send you to your email.
Yogini Prabhu
Yogini Prabhu 2020 年 12 月 18 日
Hi Shaunak,
can the Adiition layer and depth concatenation layer be used , if we have two diffrent datasets to be utilised for 2 different NN (classification type) and decision be made on results of both,eg if one has got defect in eye (retina dataset and iris dataset)

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

カテゴリ

Help Center および File ExchangeParallel and Cloud についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by