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:
Explanation of the newff command in Neural Network Toolbox

Subject: Explanation of the newff command in Neural Network Toolbox

From: James Tan

Date: 3 Sep, 2006 01:17:32

Message: 1 of 4

In matlab neural network toolbox, the newff command to create a new
backpropagation network is defined as follows:

net = newff (PR, [s1 s2... sn1],{tf1 tf2... tfn1}, BTF)

where
PR = Rx2 matrix of min and max values for R input elements
Si = Size of the ith layer
TFi = Activation (or transfer function) of the ith layer
BTF = Network training function

I would like a explanation of what input elements mean. Does it mean
the number of input neurons in the newly created neural network?

Thanks in advance.

Subject: Explanation of the newff command in Neural Network Toolbox

From: Greg Heath

Date: 3 Sep, 2006 06:11:05

Message: 2 of 4

James Tan wrote:
> In matlab neural network toolbox, the newff command to create a new
> backpropagation network is defined as follows:
>
> net = newff (PR, [s1 s2... sn1],{tf1 tf2... tfn1}, BTF)

The type of network is a feedforward multilayer perceptron (MLP).
Backpropagation is the name of a method which can be used to
train networks, including the MLP.
Backpropagation is neither a type of network nor the name of a
network.

> where
> PR = Rx2 matrix of min and max values for R input elements
> Si = Size of the ith layer
> TFi = Activation (or transfer function) of the ith layer
> BTF = Network training function
>
> I would like a explanation of what input elements mean. Does it mean
> the number of input neurons in the newly created neural network?

Input nodes are not neurons. "Neuron" is used to indicate
the output node of an activation function.

If you have a matrix of N I-dimensional input vectors, p, with
dim(p) = [ I N ], then

net = newff(minmax(p), [H O], {'tansig' 'purelin'});

will create an I-H-O MLP with I input nodes, H hidden-layer
nodes and O output nodes using the default training algorithm
'trainlm'. For large problems 'trainlm' may run out of memory
and bomb. Then it is better to use

net = newff(minmax(p), [H O], {'tansig' 'purelin'},'trainscg');

See my post on pretraining advice.

Hope this helps.

Greg

Subject: Explanation of the newff command in Neural Net

From: James Tan

Date: 3 Sep, 2006 09:35:41

Message: 3 of 4

First of all, thanks for your help on the input elements. Concerning
about the newff command,

1. Are all feedforward MLP networks created using this command can
only contain 1 output node? If there can be more than 1 output node,
what is the method to create more than 1 output node?

2. Do each input to this network created using newff command must
contain min and max values? Is there any method to input only 1 value
for each input node to the network?

Thanks in advance.

 Greg Heath wrote:
>
>
> James Tan wrote:
>> In matlab neural network toolbox, the newff command to create a
> new
>> backpropagation network is defined as follows:
>>
>> net = newff (PR, [s1 s2... sn1],{tf1 tf2... tfn1}, BTF)
>
> The type of network is a feedforward multilayer perceptron (MLP).
> Backpropagation is the name of a method which can be used to
> train networks, including the MLP.
> Backpropagation is neither a type of network nor the name of a
> network.
>
>> where
>> PR = Rx2 matrix of min and max values for R input elements
>> Si = Size of the ith layer
>> TFi = Activation (or transfer function) of the ith layer
>> BTF = Network training function
>>
>> I would like a explanation of what input elements mean. Does it
> mean
>> the number of input neurons in the newly created neural
network?
>
> Input nodes are not neurons. "Neuron" is used to indicate
> the output node of an activation function.
>
> If you have a matrix of N I-dimensional input vectors, p, with
> dim(p) = [ I N ], then
>
> net = newff(minmax(p), [H O], {'tansig' 'purelin'});
>
> will create an I-H-O MLP with I input nodes, H hidden-layer
> nodes and O output nodes using the default training algorithm
> 'trainlm'. For large problems 'trainlm' may run out of memory
> and bomb. Then it is better to use
>
> net = newff(minmax(p), [H O], {'tansig' 'purelin'},'trainscg');
>
> See my post on pretraining advice.
>
> Hope this helps.
>
> Greg
>
>

Subject: Explanation of the newff command in Neural Net

From: Greg Heath

Date: 3 Sep, 2006 12:22:38

Message: 4 of 4

James: in the future, please do not top post. Write your replies
beneath
(or within) the previous post.

James Tan wrote:
> First of all, thanks for your help on the input elements. Concerning
> about the newff command,
>
> 1. Are all feedforward MLP networks created using this command can
> only contain 1 output node? If there can be more than 1 output node,
> what is the method to create more than 1 output node?

Reread my post.

> 2. Do each input to this network created using newff command must
> contain min and max values?

I don't understand your question: Every group of numbers has a min
and a max.

> Is there any method to input only 1 value
> for each input node to the network?
> Thanks in advance.

You're welcome in advance.

minmax(p) is not the input to the network. It is the input to the
newff algorithm. I don't know why it is there. My best guess is
that the min and max values of the inputs are used to generate
the initial random weights.

The input to the network is p and the network is trained via

net = train(net,p,t);

Hope this helps.

Greg

> Greg Heath wrote:
> >
> >
> > James Tan wrote:
> >> In matlab neural network toolbox, the newff command to create a
> > new
> >> backpropagation network is defined as follows:
> >>
> >> net = newff (PR, [s1 s2... sn1],{tf1 tf2... tfn1}, BTF)
> >
> > The type of network is a feedforward multilayer perceptron (MLP).
> > Backpropagation is the name of a method which can be used to
> > train networks, including the MLP.
> > Backpropagation is neither a type of network nor the name of a
> > network.
> >
> >> where
> >> PR = Rx2 matrix of min and max values for R input elements
> >> Si = Size of the ith layer
> >> TFi = Activation (or transfer function) of the ith layer
> >> BTF = Network training function
> >>
> >> I would like a explanation of what input elements mean. Does it
> > mean
> >> the number of input neurons in the newly created neural
> network?
> >
> > Input nodes are not neurons. "Neuron" is used to indicate
> > the output node of an activation function.
> >
> > If you have a matrix of N I-dimensional input vectors, p, with
> > dim(p) = [ I N ], then
> >
> > net = newff(minmax(p), [H O], {'tansig' 'purelin'});
> >
> > will create an I-H-O MLP with I input nodes, H hidden-layer
> > nodes and O output nodes using the default training algorithm
> > 'trainlm'. For large problems 'trainlm' may run out of memory
> > and bomb. Then it is better to use
> >
> > net = newff(minmax(p), [H O], {'tansig' 'purelin'},'trainscg');
> >
> > See my post on pretraining advice.
> >
> > Hope this helps.
> >
> > Greg
> >
> >

Tags for this Thread

No tags are associated with 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