Neural Network Toolbox Previous page   Next Page
learnsom

Self-organizing map weight learning function

Syntax

[dW,LS] = learnsom(W,P,Z,N,A,T,E,gW,gA,D,LP,LS)

info = learnsom(code)

Description

learnsom is the self-organizing map weight learning function.

learnsom(W,P,Z,N,A,T,E,gW,gA,D,LP,LS) takes several inputs,

and returns,

Learning occurs according to learnsom's learning parameter, shown here with its default value.

learnpn(code) returns useful information for each code string:

Examples

Here we define a random input P, output A, and weight matrix W, for a layer with a two-element input and six neurons. We also calculate positions and distances for the neurons, which are arranged in a 2-by-3 hexagonal pattern. Then we define the four learning parameters.

Since learnsom only needs these values to calculate a weight change (see algorithm below), we will use them to do so.

Network Use

You can create a standard network that uses learnsom with newsom.

  1. Set net.trainFcn to 'trainr'. (net.trainParam will automatically become trainr's default parameters.)
  2. Set net.adaptFcn to 'trains'. (net.adaptParam will automatically become trains's default parameters.)
  3. Set each net.inputWeights{i,j}.learnFcn to 'learnsom'. Set each net.layerWeights{i,j}.learnFcn to 'learnsom'. Set net.biases{i}.learnFcn to 'learnsom'. (Each weight learning parameter property will automatically be set to learnsom's default parameters.)

To train the network (or enable it to adapt)

  1. Set net.trainParam (net.adaptParam) properties to desired values.
  2. Call train (adapt).

Algorithm

learnsom calculates the weight change dW for a given neuron from the neuron's input P, activation A2, and learning rate LR:

where the activation A2 is found from the layer output A and neuron distances D and the current neighborhood size ND:

The learning rate LR and neighborhood size NS are altered through two phases: an ordering phase and a tuning phase.

The ordering phases lasts as many steps as LP.order_steps. During this phase LR is adjusted from LP.order_lr down to LP.tune_lr, and ND is adjusted from the maximum neuron distance down to 1. It is during this phase that neuron weights are expected to order themselves in the input space consistent with the associated neuron positions.

During the tuning phase LR decreases slowly from LP.tune_lr and ND is always set to LP.tune_nd. During this phase the weights are expected to spread out relatively evenly over the input space while retaining their topological order found during the ordering phase.

See Also

adapt, train


Previous page  learnpn learnwh Next page

© 1994-2005 The MathWorks, Inc.