Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.



Re: multiple inputs in neural network toolbox
Posted:
Jul 8, 2013 11:52 AM


"Ahmed Abdullah" <abdullah.ahmed21@yahoo.com> wrote in message <krdrmh$jmo$1@newscl01ah.mathworks.com>... > I know how to give one input (multidimensional)  > > P=[1 2 32 2 ; > 2 3 4 5] ; % 4 training sample each inputs have 2 element > > T=[1 4 2 3] ; % corresponding output for 4 sample
[I N ] = size(P) % [ 2 4 ] [ O N ] = size(T) % [ 1 4 ] Ntrn = N 2*round(0.15*N) % 2
%==>Default data division: 2 training examples, 1 validation and 1 test
Ntrneq = Ntrn*O % only 2 training equations
> net=feedforwardnet;
This will cause the net to have H=10 (the default) hidden nodes. The number of unknown weights is
Nw = (I+1)*H+(H+1)*O % 30+11=41
You have 2 equations to solve for 41 variables.
Obviously, this is a ridiculous example.
> net=configure(P,T);
Delete. Train will automatically configure an empty net.
> net=train(P,T);
Incorrect
net = train(net,P,T);
Y = net(P);
E = TY;
MSE = mse(E)
NMSE = MSE/var(T,1) % Normalized MSE desired to be << 1 > So you see i know how to give 1 input (multidimensional). But I don't know how to give two? you see . I just want to know the format of input Matrix or Cell
Although you used a ridiculous example and an incorrect training syntax, you've asked an excellent question.
net.numinputs = 2;
creates a net with 2 inputs. Each can have a different dimensionality. Typically they would be connected to different hidden layers (e.g. 2 in parallel and both hidden layers connected to an output layer). See the documentation section on custom networks for details.
My problem is I can construct the network but I don't know how to tell train that there are 2 inputs.
Will try to find out.
More later.
Greg



