<< SelectRandomly CLUSTER

CLUSTER >> CLUSTER > TrainSOM

TrainSOM

trains a self organizing map (SOM).

Calling Sequence

[SOMWeights] = TrainSOM(Samples, InitialWeights, GridSize, LearningRate, LearningRateParameter, Neighborhood, NeighborhoodParameter, NormType)

Parameters

Samples:

matrix that includes training vectors as rows

InitialWeights:

matrix that includes initial weight vectors as rows

GridSize:

vector or scalar, specifies the number of neurons per SOM dimension. All elements must be greater than one.

LearningRate:

function of time step and an additional parameter

LearningRateParameter:

2nd parameter passed to LearningRate(), can be of any type

Neighborhood:

function of distance, time step and an additional parameter

NeighborhoodParameter:

3rd parameter passed to Neighborhood(), can be of any type

NormType:

norm of vectors, must be a scalar greater than zeros, can be %inf

SOMWeights:

matrix that includes resulting weight vectors as rows

Description

This function trains a self organizing map (SOM).

Examples

global CLUSTER_PATH;
Source = read_csv(CLUSTER_PATH + 'demos\IrisData.csv', ascii(9));
Samples = strtod(Source(:, 1 : 4));
GridSize = [5 3];
InitialWeights = InitSOM(Samples, GridSize, 'equidistant');
LearningRateStruct = struct('Max', 0.2, 'Min', 0.02, 'Duration', size(Samples, 1));
function [Result]=LinearLearningRate(TimeStep, Parameter)
Result = Parameter.Max - (Parameter.Max - Parameter.Min) * (TimeStep - 1) / (Parameter.Duration - 1);
endfunction
NeighborhoodStruct = struct('Max', 5, 'Duration', size(Samples, 1));
function [Result]=CircularNeighborhood(Distance, TimeStep, Parameter)
MaxDistance = Parameter.Max - (Parameter.Max - 1) * (TimeStep - 1) / (Parameter.Duration - 1);
Result = double(Distance <= MaxDistance);
endfunction
SOMWeights = TrainSOM(Samples, ...
InitialWeights, ...
GridSize, ...
LinearLearningRate, ...
LearningRateStruct, ...
CircularNeighborhood, ....
NeighborhoodStruct, ...
2)

See also

Authors

Bibliography

T. Kohonen, 'Self-organizing maps', Springer Verlag, Berlin, 2001


Report an issue
<< SelectRandomly CLUSTER