The Math Forum

Search All of the Math Forum:

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

Math Forum » Discussions » Software » comp.soft-sys.matlab

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

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   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
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Ahmed Abdullah" <> wrote in message <krdrmh$jmo$>...
> 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);


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
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.


Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.