Neural Network Toolbox |
Creating a Perceptron (newp)
A perceptron can be created with the function newp
Commonly the hardlim
function is used in perceptrons, so it is the default.
The code below creates a perceptron network with a single one-element input vector and one neuron. The range for the single element of the single input vector is [0 2].
We can see what network has been created by executing the following code
inputweights = delays: 0 initFcn: 'initzero' learn: 1 learnFcn: 'learnp' learnParam: [] size: [1 1] userdata: [1x1 struct] weightFcn: 'dotprod'
Note that the default learning function is learnp
, which is discussed later in this chapter. The net input to the hardlim
transfer function is dotprod
, which generates the product of the input vector and weight matrix and adds the bias to compute the net input.
Also note that the default initialization function, initzero
, is used to set the initial values of the weights to zero.
biases = initFcn: 'initzero' learn: 1 learnFcn: 'learnp' learnParam: [] size: 1 userdata: [1x1 struct]
We can see that the default initialization for the bias is also 0.
Perceptron Architecture | Simulation (sim) |
© 1994-2005 The MathWorks, Inc.