How to create a simple fully connected neural network with multiple outputs?

20 ビュー (過去 30 日間)
Mahmoud Elzouka
Mahmoud Elzouka 2022 年 11 月 9 日
編集済み: Ashu 2022 年 12 月 14 日
I need to create a fully connected neural network that can have multiple otputs.
I see RegressionNeuralNetwork is a very good solution for me, but its output size can only be 1.
Please refer me to an example.

回答 (1 件)

Ashu
Ashu 2022 年 11 月 30 日
Hey Mahmoud,
To train a network with multiple outputs, you must train the network using a custom training loop.
Example on Training and Inferencing Multiple Output Neural Network : https://www.mathworks.com/help/deeplearning/ug/train-network-with-multiple-outputs.html
To understand more about Multiple Input and Output Neural Networks : https://www.mathworks.com/help/deeplearning/ug/multiple-input-and-multiple-output-networks.html
Regards
  2 件のコメント
Mahmoud Elzouka
Mahmoud Elzouka 2022 年 11 月 30 日
Thanks @Ashu for your answer.
I would like to "create" the NN from known parameters (i.e., biases and weights). Would you please share an example?
Ashu
Ashu 2022 年 12 月 13 日
編集済み: Ashu 2022 年 12 月 14 日
Hey Mahmood,
To set the weights and biases, you can use 'setwb'.
Here is a small example of creating a network with multiple outputs :
x = randn(18,141); % input data
t = randn(18,141); % ground truth label
net = feedforwardnet([ 36 36 ]);
net = train(net,x,t);
view(net)
Now to set the weights and biases -
net = setwb(net,rand(10,1));
To view the parameter values-
net.IW{1,1}
net.b{1}
To know more about 'setwb' you can refer this -

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by