| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Neural Network Toolbox |
| Contents | Index |
Self-organizing map weight learning function
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,
| dW |
S x R weight (or bias) change matrix |
| LS |
New learning state |
Learning occurs according to learnsom's learning parameters, shown here with their default values.
| LP.order_lr |
0.9 |
Ordering phase learning rate |
|
| LP.order_steps |
1000 |
Ordering phase steps |
|
| LP.tune_lr |
0.02 |
Tuning phase learning rate |
|
| LP.tune_nd |
1 |
Tuning phase neighborhood distance |
learnsom(code) returns useful information for each code string:
| 'pnames' |
Names of learning parameters |
| 'pdefaults' |
Default learning parameters |
| 'needg' |
Returns 1 if this function uses gW or gA |
Here you define a random input P, output A, and weight matrix W for a layer with a two-element input and six neurons. You also calculate positions and distances for the neurons, which are arranged in a 2-by-3 hexagonal pattern. Then you define the four learning parameters.
p = rand(2,1); a = rand(6,1); w = rand(6,2); pos = hextop(2,3); d = linkdist(pos); lp.order_lr = 0.9; lp.order_steps = 1000; lp.tune_lr = 0.02; lp.tune_nd = 1;
Because learnsom only needs these values to calculate a weight change (see algorithm below), use them to do so.
You can create a standard network that uses learnsom with newsom.
To train the network (or enable it to adapt):
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, 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, determined during the ordering phase.
| Provide feedback about this page |
![]() | learnpn | learnsomb | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |