Neural network where each input neuron has multiple dimensions and each output neuron has the same dimensions.

2 views (last 30 days)
Hello all,
I am getting started on using Neural networks as a way to predict a physics based calculation.
I have multiple input files and corresponding output files from the calculation. I would like to use these input files as training data for my neural network and use the output files as validation and testing.
My question is this: Each input file is a 99 x 12 matrix and each output file is a 99 x 12 matrix. I would like to have 99 input neurons to take in 1 vector of length 12 and have 99 output neurons where each output a vector of size 12.
I want to train on multiple input files with their corresponding output files.
I am not quite sure how to go about setting up my network for this operation. I.e how would I present all the training data to the network, and how would I set up the architecture for my network. I am looking to use a feedforward network.
Thanks!

Accepted Answer

Greg Heath
Greg Heath on 25 Nov 2015
1. Hidden and output nodes are neurons.
2. Input nodes are not neurons.
3. Input and output vectors are columns, not rows.
4. A 12-dimensional input column vector requires 12 input nodes.
5. The input vectors are columns of a 12x99 dimensional matrix.
6. A 12-dimensional output colmn vector requires 12 output nodes
which are neurons.
7. The output vectors are columns of a 12x99 dimensional matrix
8. Obviously you can transpose matrices before and after if you
are dealing with row vectors.
Hope this helps
Thank you for formally accepting my answer
Greg
  2 Comments
Jacob Chen
Jacob Chen on 25 Nov 2015
Does this setup assume that each column is independent of all other columns? I have data where the rows do depend on the surrounding rows. They are indexed by time and it does play a factor in the resulting calculation. I am trying to simulate inverse dynamics of a musculoskeletal model.
Greg Heath
Greg Heath on 27 Nov 2015
No such assumptions are made in the regression/curve-fitting or classification/pattern-recognition functions FITNET and PATTERNNET, respectively.
However, correlation assumptions are assumed in the timeseries functions TIMEDELAYNET, NARNET and NARXNET.
For examples, see the documentation.
help narxnet
doc narxnet.
Hope this helps.
Greg

Sign in to comment.

More Answers (2)

Greg Heath
Greg Heath on 23 Nov 2015
What you are asking make no sense. N I-dimensional input column vectors and corresponding N O-dimensional output target column vectors are contained in the input and target matrices x and t, respectively, with corresponding sizes
[ I N ] = size(x)
[ O N ] = size(t)
The neural network has one hidden layer with H neurons yielding an I-H-O node topology.
Hope this helps.
Thank you for formally accepting my answer
Greg
  1 Comment
Jacob Chen
Jacob Chen on 23 Nov 2015
Hm. Well what I'm asking is that each input neuron in the input layer takes in a vector of dimension 12. Each "training" iteration is where I have q files where each file is a 99x12 matrix. So I would have q training sessions. Each output is then a 99x12 matrix. I'd like 99 number of inputs with 99 number of outputs. But I need each input to have a row vector of size 1x12 and each output to have a vector of size 1x12. Would I be able set up my network to handle this?

Sign in to comment.


Greg Heath
Greg Heath on 4 Jan 2016
Edited: Greg Heath on 4 Jan 2016
> Hm. Well what I'm asking is that each input neuron in the input layer takes in a vector of dimension 12. <
I repeat:
1. Input nodes are not neurons
2. I dimensional inputs require I input nodes; one scalar
variable per node. I = 12.
3. Similarly for O-dimensional outputs. O = 12.
4. Each input and output vector is a column, not a row.
> Each "training" iteration is where I have q files where each file is a 99x12 matrix. So I would have q training sessions. Each output is then a 99x12 matrix. I'd like 99 number of inputs with 99 number of outputs. But I need each input to have a row vector of size 1x12 and each output to have a vector of size 1x12. Would I be able set up my network to handle this? <
You cannot have q separate training sessions on the same net with
different data. Learning file 2 will cause some forgetting of file 1,
... learning file n will cause some forgetting of the previous n-1
files.
Concatenate your 2*q matrices to obtain 2 matrices:
[ I N ] = size(input) % [ 12 99*q]
[ O N ] = size(target) % [ 12 99*q]
Hope this helps
Thank you for formally accepting my answer
Greg

Community Treasure Hunt

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

Start Hunting!