How to create Multiple Output Neural Networks

Hi,
I am using the custom neural network maker network () to create my own architecture. However, I want multiple outputs to come from one layer (the last layer) but I am only able to make one output from the net. Is there anyway to do this?
I dont want to make a new network for each layer.
Kind regards,
E

 Accepted Answer

Greg Heath
Greg Heath on 16 Apr 2017
Edited: Greg Heath on 19 Apr 2017
It is very simple:
For N I-dimensional "I"nputs paired with N O-dimensional "O"utput targets
[ I N ] = size(inputmatrix)
[ O N ] = size(targetmatrix)
Hope this helps.
Thank you for formally accepting my answer
Greg

4 Comments

Hi Greg, thank you for your reply.
I dont quite understand how i can implement this using the matlab function 'network' when the output variable is a read-only value, it cannot be assigned dimension.
E
The target matrix contains N columns of O-dimensional vectors with nonnegative unit sum components that can be interpreted as conditional (on the input) probabilities.
Each of the O-dimensions represent an output category.
Hope this helps.
Greg
Greg,
Is it possible to set up a structure where
[I N1] = size(inputmatrix);
[O N2] = size(outputmatrix);
N1 /= N2?
I know that other programs such as TensorFlow can do it. I don't understand why the second dimension needs to match.
NO!
EACH of the N O-dimensional "O"utput target column vectors is the desired output for ONE of the N I-dimensional "I"nput column vectors.
Why?
Because that is the MATLAB NN convention regardless if it's pattern-recognition/classification or curve-fitting/regression.
EXAMPLE: For two-class classification, the targets are either [1 0 ]' or [0 1 ]'. However, if you have 60 inputs from class 1 and 40 from class 2, you still need 100 target columns.
Hope this helps.
Greg

Sign in to comment.

More Answers (1)

Hi;
I want to find out the algoritm used to coding 8 bit digital input to 8 bit digital out put can i find it by using neural networks in matlab? and can any one give me a brief instruction...
thanks...

Categories

Find more on Deep Learning Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!