Neural Network Toolbox |
Layers
These properties define the details of each ith network layer.
dimensions
This property defines the physical dimensions of the ith layer's neurons. Being able to arrange a layer's neurons in a multidimensional manner is important for self-organizing maps.
It can be set to any row vector of 0 or positive integer elements, where the product of all the elements will becomes the number of neurons in the layer (net.layers{i}.size
).
Uses. Layer dimensions are used to calculate the neuron positions within the layer (net.layers{i}.positions
) using the layer's topology function (net.layers{i}.topologyFcn
).
Side Effects. Whenever this property is altered, the layers's size (net.layers{i}.size
) changes to remain consistent. The layer's neuron positions (net.layers{i}.positions
) and the distances between the neurons (net.layers{i}.distances
) are also updated.
distanceFcn
This property defines the function used to calculate distances between neurons in the ith layer (net.layers{i}.distances
) from the neuron positions (net.layers{i}.positions
). Neuron distances are used by self-organizing maps.
It can be set to the name of any distance function, including these toolbox functions.
Distance Functions | |
|
Distance between two position vectors. |
|
Euclidean distance weight function. |
|
Link distance function. |
|
Manhattan distance weight function. |
Custom Functions.. See Advanced Topics for information on creating custom distance functions.
Side Effects. Whenever this property is altered, the distance between the layer's neurons (net.layers{i}.distances
) is updated.
distances (read-only)
This property defines the distances between neurons in the ith layer. These distances are used by self-organizing maps.
It is always set to the result of applying the layer's distance function (net.layers{i}.distanceFcn
) to the positions of the layers neurons (net.layers{i}.positions
).
initFcn
This property defines the initialization function used to initialize the ith layer, if the network initialization function (net.initFcn
) is initlay
.
It can be set to the name of any layer initialization function, including these toolbox functions.
Layer Initialization Functions | |
|
Nguyen-Widrow layer initialization function. |
|
By-weight-and-bias layer initialization function. |
If the network initialization is set to initlay
, then the function indicated by this property is used to initialize the layer's weights and biases when init
is called.
Custom Functions.. See Advanced Topics for information on creating custom initialization functions.
netInputFcn
This property defines the net input function use to calculate the ith layer's net input, given the layer's weighted inputs and bias.
It can be set to the name of any net input function, including these toolbox functions.
Net Input Functions | |
|
Product net input function. |
|
Sum net input function. |
The net input function is used to simulate the network when sim
is called.
Custom Functions.. See Advanced Topics for information on creating custom net input functions.
positions (read-only)
This property defines the positions of neurons in the ith layer. These positions are used by self-organizing maps.
It is always set to the result of applying the layer's topology function (net.layers{i}.topologyFcn
) to the positions of the layer's dimensions (net.layers{i}.dimensions
).
Plotting. Use plotsom
to plot the positions of a layer's neurons.
For instance, if the first layer neurons of a network are arranged with dimensions (net.layers{1}.dimensions
) of [4 5] and the topology function (net.layers{1}.topologyFcn
) is hextop
, the neuron's positions can be plotted as shown below.
size
This property defines the number of neurons in the ith layer.
It can be set to 0 or a positive integer.
Side Effects. Whenever this property is altered, the sizes of any input weights going to the layer (net.inputWeights{i,:}.size
), and any layer weights going to the layer (net.layerWeights{i,:}.size
) or coming from the layer (net.inputWeights{i,:}.size
), and the layer's bias (net.biases{i}.size
) change.
The dimensions of the corresponding weight matrices (net.IW{i,:}
, net.LW{i,:}
, net.LW{:,i}
) and biases (net.b{i}
) also change.
Changing this property also changes the size of the layer's output (net.outputs{i}.size
) and target (net.targets{i}.size
) if they exist.
Finally, when this property is altered, the dimensions of the layer's neurons (net.layers{i}.dimension
) are set to the same value. (This results in a one-dimensional arrangement of neurons. If another arrangement is required, set the dimensions
property directly instead of using size
).
topologyFcn
This property defines the function used to calculate the ith layer's neuron positions (net.layers{i}.positions
) from the layer's dimensions (net.layers{i}.dimensions
).
It can be set to the name of any topology function, including these toolbox functions.
Topology Functions | |
|
Gridtop layer topology function. |
|
Hexagonal layer topology function. |
|
Random layer topology function. |
Custom functions.. See Advanced Topics for information on creating custom topology functions.
Side Effects. Whenever this property is altered, the positions of the layer's neurons (net.layers{i}.positions
) is updated.
Plotting. Use plotsom
to plot the positions of a layer's neurons.
For instance, if the first layer neurons of a network are arranged with dimensions (net.layers{1}.dimensions
) of [8 10] and the topology function (net.layers{1}.topologyFcn
) is randtop
, the neuron's positions are arranged something like those shown in the plot below.
transferFcn
This function defines the transfer function used to calculate the ith layer's output, given the layer's net input.
It can be set to the name of any transfer function, including these toolbox functions.
Transfer Functions | |
|
Competitive transfer function. |
|
Hard-limit transfer function. |
|
Symmetric hard-limit transfer function. |
|
Log-sigmoid transfer function. |
|
Positive linear transfer function. |
|
Hard-limit transfer function. |
|
Radial basis transfer function. |
|
Saturating linear transfer function. |
|
Symmetric saturating linear transfer function. |
|
Soft max transfer function. |
|
Hyperbolic tangent sigmoid transfer function. |
|
Triangular basis transfer function. |
The transfer function is used to simulate the network when sim
is called.
Custom functions.. See Advanced Topics for information on creating custom transfer functions.
userdata
This property provides a place for users to add custom information to the ith network layer.
Only one field is predefined. It contains a secret message to all Neural Network Toolbox users.
Subobject Properties | Outputs |
© 1994-2005 The MathWorks, Inc.