Multiple input feedforward network

조회 수: 11 (최근 30일)
Jana
Jana 2012년 3월 31일
I want to create a feedforward neural network with two input vectors and only one output vector. I've tried different things but I don't succeed.
I've tried:
P = [P1 P2];
net = newff(P,T);
But when I look at the architecture of the network it says:
numInputs: 1
Also when I try to train the network:
net = train(net,P,T);
I get the following error message:
??? Error using ==> network.train at 145
Targets are incorrectly sized for network.
Matrix must have 2 columns.
Error in ==> Problem1 at 90
net = train(net,P,T);
Is there anyone who can help me? I cannot seem to find a solution.
Maybe I should add: Both my input vectors (P1, P2) and also my target vector (T) have dimension [1000x1].
Jana

채택된 답변

Greg Heath
Greg Heath 2012년 4월 1일
>I want to create a feedforward neural network with two input vectors and only one output vector. I've tried different things but I don't succeed.
>I've tried:
>P = [P1 P2];net = newff(P,T);
If P1 and P2 are 1-D column vectors, then you need a lot more data.
For an I-H-O feedforward net, with
[I N] =size(P)
[O N] = size(T)
Neq = N*O % No. of training equations
Nw = (I+1)*H+(H+1)*O % No. of unknown weights
To mitigate measurement error, noise and differences between training and nontraining data, is desirable to have Neq >> Nw which is equivalent to
N >> Nw/H
or
H << (Neq-O)/(I+O+1)
>But when I look at the architecture of the network it says: numInputs: 1
That is correct. 1 input of dimensionality I=size(P,1)
>Also when I try to train the network:
>net = train(net,P,T);
This assumes a default of H = 10
>I get the following error message:
>??? Error using ==> network.train at 145 >Targets are incorrectly sized for network. Matrix must have 2 columns. Error in ==> Problem1 at 90 net = train(net,P,T); >Is there anyone who can help me? I cannot seem to find a solution.
>Maybe I should add: Both my input vectors (P1, P2) and also my >target vector (T) have dimension [1000x1].
See above for correct sizes for P and T and constraint on size of H.
Hope this helps.
Greg
  댓글 수: 2
Jana
Jana 2012년 4월 2일
I have trouble understanding your way of notating things.
What do you mean with [I N] and [O N]
I'm still altering the number of hidden neurons (and layers) in my network to find proper architecture.
Also I have transposed my vectors so now I have:
Input P [2x1000]
Target T [1x1000]
I hope this is the way to have two inputs in a network with one output?
Greg Heath
Greg Heath 2012년 4월 3일
You have answered your own question for a feedforward net with I-H-O (Input-Hidden-Output) node topology.
size(P)
size(T)
Greg

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by