Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: multiple inputs in neural network toolbox
Replies: 4   Last Post: Jul 13, 2013 2:43 PM

 Messages: [ Previous | Next ]
 Greg Heath Posts: 6,387 Registered: 12/7/04
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 = T-Y;

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

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

Date Subject Author
7/8/13 Ahmed Abdullah
7/8/13 Greg Heath
7/8/13 Ahmed Abdullah
7/11/13 Greg Heath
7/13/13 Ahmed Abdullah