Multiple input feedforward network
11 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
采纳的回答
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 个评论
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 Center 和 File Exchange 中查找有关 Deep Learning Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!