Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Neural Network Configurations (numInputs)

Subject: Neural Network Configurations (numInputs)

From: Mohammed Khalilia

Date: 23 Feb, 2010 18:56:20

Message: 1 of 7

This seems silly, but I am confused about the number of inputs to the neural network (net.numInputs). I have a matrix of size 10000x259, are the number of input sources in this case 10000 (number of observations=10000, number of features=259)?

According to the MATLAB Neural Network manual:
"net.numInputs is the number of input sources, not the number of elements in
an input vector (net.inputs{i}.size)."

Thank you,

Subject: Neural Network Configurations (numInputs)

From: Sadik

Date: 23 Feb, 2010 22:58:07

Message: 2 of 7

Hello Mohammed,

I don't have much experience in neural networks but from what you have written, my understanding is you should set numInputs = 259. net.inputs{i}.size mentioned in the manual will be equal to 1000.

You have 259 input vectors.
Each is 1000 elements long.

Hope this helps.

Best.


"Mohammed Khalilia" <mohammedsk@gmail.com> wrote in message <hm18ck$nae$1@fred.mathworks.com>...
> This seems silly, but I am confused about the number of inputs to the neural network (net.numInputs). I have a matrix of size 10000x259, are the number of input sources in this case 10000 (number of observations=10000, number of features=259)?
>
> According to the MATLAB Neural Network manual:
> "net.numInputs is the number of input sources, not the number of elements in
> an input vector (net.inputs{i}.size)."
>
> Thank you,

Subject: Neural Network Configurations (numInputs)

From: Mohammed Khalilia

Date: 24 Feb, 2010 00:23:09

Message: 3 of 7

"Sadik " <sadik.hava@gmail.com> wrote in message <hm1mhu$7q1$1@fred.mathworks.com>...
> Hello Mohammed,
>
> I don't have much experience in neural networks but from what you have written, my understanding is you should set numInputs = 259. net.inputs{i}.size mentioned in the manual will be equal to 1000.
>
> You have 259 input vectors.
> Each is 1000 elements long.
>
> Hope this helps.
>
> Best.
>
>
> "Mohammed Khalilia" <mohammedsk@gmail.com> wrote in message <hm18ck$nae$1@fred.mathworks.com>...
> > This seems silly, but I am confused about the number of inputs to the neural network (net.numInputs). I have a matrix of size 10000x259, are the number of input sources in this case 10000 (number of observations=10000, number of features=259)?
> >
> > According to the MATLAB Neural Network manual:
> > "net.numInputs is the number of input sources, not the number of elements in
> > an input vector (net.inputs{i}.size)."
> >
> > Thank you,

Thank you. That is what I thought. So it is really the length of the feature vector.

Subject: Neural Network Configurations (numInputs)

From: Greg Heath

Date: 25 Feb, 2010 10:00:50

Message: 4 of 7

On Feb 23, 7:23 pm, "Mohammed Khalilia" <mohamme...@gmail.com> wrote:
> "Sadik " <sadik.h...@gmail.com> wrote in message <hm1mhu$7q...@fred.mathworks.com>...
> > Hello Mohammed,
>
> > I don't have much experience in neural networks but from what you have written, my understanding is you should set numInputs = 259. net.inputs{i}.size mentioned in the manual will be equal to 1000.
>
> > You have 259 input vectors.
> > Each is 1000 elements long.
>
> > Hope this helps.
>
> > Best.
>
> > "Mohammed Khalilia" <mohamme...@gmail.com> wrote in message <hm18ck$na...@fred.mathworks.com>...
> > > This seems silly, but I am confused about the number of inputs to the neural network (net.numInputs). I have a matrix of size 10000x259, are the number of input sources in this case 10000 (number of observations=10000, number of features=259)?
>
> > > According to the MATLAB Neural Network manual:
> > > "net.numInputs is the number of input sources, not the number of elements in
> > > an input vector (net.inputs{i}.size)."
>
> > > Thank you,
>
> Thank you. That is what I thought. So it is really the length of the feature vector.-

No, that is contrary to

" ... not the number of elements in an input vector "

Why not test it.

p = randn(9,99); t = ones(1,99)+0.5*sum(p);
net = newff(minmax(p), [3 1]) % OMIT THE SEMICOLON


Hope this helps.

Greg

Subject: Neural Network Configurations (numInputs)

From: Mohammed Khalilia

Date: 1 Mar, 2010 15:01:08

Message: 5 of 7

Greg Heath <heath@alumni.brown.edu> wrote in message <4d2d4068-f808-4f23-a71a-e89539a98523@b30g2000yqd.googlegroups.com>...
> On Feb 23, 7:23 pm, "Mohammed Khalilia" <mohamme...@gmail.com> wrote:
> > "Sadik " <sadik.h...@gmail.com> wrote in message <hm1mhu$7q...@fred.mathworks.com>...
> > > Hello Mohammed,
> >
> > > I don't have much experience in neural networks but from what you have written, my understanding is you should set numInputs = 259. net.inputs{i}.size mentioned in the manual will be equal to 1000.
> >
> > > You have 259 input vectors.
> > > Each is 1000 elements long.
> >
> > > Hope this helps.
> >
> > > Best.
> >
> > > "Mohammed Khalilia" <mohamme...@gmail.com> wrote in message <hm18ck$na...@fred.mathworks.com>...
> > > > This seems silly, but I am confused about the number of inputs to the neural network (net.numInputs). I have a matrix of size 10000x259, are the number of input sources in this case 10000 (number of observations=10000, number of features=259)?
> >
> > > > According to the MATLAB Neural Network manual:
> > > > "net.numInputs is the number of input sources, not the number of elements in
> > > > an input vector (net.inputs{i}.size)."
> >
> > > > Thank you,
> >
> > Thank you. That is what I thought. So it is really the length of the feature vector.-
>
> No, that is contrary to
>
> " ... not the number of elements in an input vector "
>
> Why not test it.
>
> p = randn(9,99); t = ones(1,99)+0.5*sum(p);
> net = newff(minmax(p), [3 1]) % OMIT THE SEMICOLON
>
>
> Hope this helps.
>
> Greg

I think the numInputs make sense to me now. I have another questions, how can I make the output of the NN when I run Y = sim(net, input) to be 0 or 1? I used logsig, but it outputs values in [0 1], is there a function that strict the values to 0 and 1?

Subject: Neural Network Configurations (numInputs)

From: Mohammed Khalilia

Date: 1 Mar, 2010 17:18:09

Message: 6 of 7

"Mohammed Khalilia" <mohammedsk@gmail.com> wrote in message <hmgkrk$1h8$1@fred.mathworks.com>...
> Greg Heath <heath@alumni.brown.edu> wrote in message <4d2d4068-f808-4f23-a71a-e89539a98523@b30g2000yqd.googlegroups.com>...
> > On Feb 23, 7:23 pm, "Mohammed Khalilia" <mohamme...@gmail.com> wrote:
> > > "Sadik " <sadik.h...@gmail.com> wrote in message <hm1mhu$7q...@fred.mathworks.com>...
> > > > Hello Mohammed,
> > >
> > > > I don't have much experience in neural networks but from what you have written, my understanding is you should set numInputs = 259. net.inputs{i}.size mentioned in the manual will be equal to 1000.
> > >
> > > > You have 259 input vectors.
> > > > Each is 1000 elements long.
> > >
> > > > Hope this helps.
> > >
> > > > Best.
> > >
> > > > "Mohammed Khalilia" <mohamme...@gmail.com> wrote in message <hm18ck$na...@fred.mathworks.com>...
> > > > > This seems silly, but I am confused about the number of inputs to the neural network (net.numInputs). I have a matrix of size 10000x259, are the number of input sources in this case 10000 (number of observations=10000, number of features=259)?
> > >
> > > > > According to the MATLAB Neural Network manual:
> > > > > "net.numInputs is the number of input sources, not the number of elements in
> > > > > an input vector (net.inputs{i}.size)."
> > >
> > > > > Thank you,
> > >
> > > Thank you. That is what I thought. So it is really the length of the feature vector.-
> >
> > No, that is contrary to
> >
> > " ... not the number of elements in an input vector "
> >
> > Why not test it.
> >
> > p = randn(9,99); t = ones(1,99)+0.5*sum(p);
> > net = newff(minmax(p), [3 1]) % OMIT THE SEMICOLON
> >
> >
> > Hope this helps.
> >
> > Greg
>
> I think the numInputs make sense to me now. I have another questions, how can I make the output of the NN when I run Y = sim(net, input) to be 0 or 1? I used logsig, but it outputs values in [0 1], is there a function that strict the values to 0 and 1?

I think I got it, I have hardlim as the transferFcn.

Subject: Neural Network Configurations (numInputs)

From: Greg Heath

Date: 2 Mar, 2010 12:43:00

Message: 7 of 7

On Mar 1, 12:18 pm, "Mohammed Khalilia" <mohamme...@gmail.com> wrote:
> "Mohammed Khalilia" <mohamme...@gmail.com> wrote in message <hmgkrk$1h...@fred.mathworks.com>...
> > Greg Heath <he...@alumni.brown.edu> wrote in message <4d2d4068-f808-4f23-a71a-e89539a98...@b30g2000yqd.googlegroups.com>...
> > > On Feb 23, 7:23 pm, "Mohammed Khalilia" <mohamme...@gmail.com> wrote:
> > > > "Sadik " <sadik.h...@gmail.com> wrote in message <hm1mhu$7q...@fred.mathworks.com>...
> > > > > Hello Mohammed,
>
> > > > > I don't have much experience inneuralnetworks but from what you have written, my understanding is you should set numInputs = 259. net.inputs{i}.size mentioned in the manual will be equal to 1000.
>
> > > > > You have 259 input vectors.
> > > > > Each is 1000 elements long.
>
> > > > > Hope this helps.
>
> > > > > Best.
>
> > > > > "Mohammed Khalilia" <mohamme...@gmail.com> wrote in message <hm18ck$na...@fred.mathworks.com>...
> > > > > > This seems silly, but I am confused about the number of inputs to theneuralnetwork (net.numInputs). I have a matrix of size 10000x259, are the number of input sources in this case 10000 (number of observations=10000, number of features=259)?
>
> > > > > > According to the MATLABNeuralNetwork manual:
> > > > > > "net.numInputs is the number of input sources, not the number of elements in
> > > > > > an input vector (net.inputs{i}.size)."
>
> > > > > > Thank you,
>
> > > > Thank you. That is what I thought. So it is really the length of the feature vector.-
>
> > > No, that is contrary to
>
> > > " ... not the number of elements in an input vector "
>
> > > Why not test it.
>
> > > p = randn(9,99); t = ones(1,99)+0.5*sum(p);
> > > net = newff(minmax(p), [3 1])         % OMIT THE SEMICOLON
>
> > > Hope this helps.
>
> > > Greg
>
> > I think the numInputs make sense to me now. I have another questions, how can I make the output of the NN when I run Y = sim(net, input) to be 0 or 1? I used logsig, but it outputs values in [0 1], is there a function that strict the values to 0 and 1?
>
> I think I got it, I have hardlim as the transferFcn.-

Hardlim is not differentiable. Therefore, it cannot be used in most
of the learning algorithms. Use logsig, then take round(Y).

Hope this helps.

Greg

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us