Using the KohonenFeatureMap class

Features of the KohonenFeatureMap class

Number of neuron layers 1 input layer, 1 feature map
Input dimension minimum: 1, maximum: 3
Number of neurons in feature map minimum: 1*1, maximum: N*M
Number of input values minimum: 1, maximum: N
Weight matrices Automatically created and initialized. One matrix connects input layer and feature map. The other matrix is not of the WeightMatrix type and connects the neurons of the feature map among themselves.
Biases Not used
One learning step includes Selection of a random input value, finding the most activated map neuron, changing of the weights

Steps to create a Kohonen Feature Map

1. Object declaration

KohonenFeatureMap kfm;

Required. Declares the object kfm to be of type KohonenFeatureMap.

 

2. Constructor call

kfm = new KohonenFeatureMap();

Required. Creates an instance of KohonenFeatureMap. This is the only constructor of the class and takes no arguments.

 

3. Create feature map

kfm.createMapLayer(xSize,ySize);

Required. Creates the net's feature map with xSize*ySize map neurons.

 

4. Define input matrix

see Using the InputMatrix class

Required. Creates the input matrix.

 

5. Connect input layer with feature map

kfm.connectLayers(im);

Required. Connects each input neuron (automatically created, depending on the dimension of the input matrix im) with each neuron of the feature map. Besides, all map neurons are connected among themselves. All weight matrices are created and initialized with random values, taken from the input matrix im (created in step 4).

 

Set initial learning rate

kfm.setInitLearningRate(x);

Sets the net's initial learning rate to x. The default value is 0.6.

 

Set initial activation area

kfm.setInitActivationArea(x);

Sets the net's initial activation area to x. The default value is the greater of both map sizes divided by 2.

 

Set final activation area

kfm.setStopArea(x);

Sets the net's final activation area to x. The default value is initActivationArea divided by 10.

 

Set maximum learning cycles

kfm.setMaxLearningCycles(x);

Sets the maximum number of learning cycles to x. The default value is -1 (no maximum).

 

Reset learning time

kfm.resetTime();

Resets the learning time.

 

6. Perform a learning cycle

kfm.learn();

Required. Performs one learning cycle. This method is usually called within a loop, which exits, if the finishedLearning() method returns true.

Information is available on:

Activation area

kfm.getActivationArea();

Returns the current activation area of the feature map.

 

Elapsed time

kfm.getElapsedTime();

Returns the time that elapsed since the learning process started.

 

Final activation area

kfm.getStopArea();

Returns the final activation area of the feature map.

 

Initial activation area

kfm.getInitActivationArea();

Returns the initial activation area of the feature map.

 

Initial learning rate

kfm.getInitLearningRate();

Returns the initial learning rate of the net.

 

Learning cycle

kfm.getLearningCycle();

Returns the current learning cycle of the net.

 

Learning rate

kfm.getLearningRate();

Returns the current learning rate of the net.

 

Map size in x

kfm.getMapSizeX();

Returns the size of the feature map in x-dimension.

 

Map size in y

kfm.getMapSizeY();

Returns the size of the feature map in y-dimension.

 

Number of weights

kfm.getNumberOfWeights();

Returns the number of weights in the weight matrix that connects the input neurons with the neurons of the feature map.

 

Weight values

kfm.getWeightValues();

Returns all weight values of the weight matrix that connects the input neurons with the neurons of the feature map.

Neural Net Components in an Object Oriented Class Structure