de.htwdd.rosenkoenig.neuro.net.training
Class KohonenTrainer

java.lang.Object
  extended by de.htwdd.rosenkoenig.neuro.net.training.KohonenTrainer

public class KohonenTrainer
extends java.lang.Object

Use this class to train a Kohonen map using a set of training patterns. KohonenTrainer performs unsupervised learning, which means the pattern is presented to the net and the weights are adjusted without taking care of a desired output.
KohonenTrainer does not use the class Pattern to define its training patterns, Kohonen training patterns are represented by a simple array of double values. This simple form of training patterns is sufficient because KohonenTrainer performs unsupervised training.

A Kohonen map "learns" by propagating a pattern, identifying the "winning" neuron (which has the weight vector with the lowest distance to the pattern vector) and "pulling" this neurons weights into the direction of the training vector.
The neighbourhood radius of the net is doubled before training starts, during the learning process the neighbourhood radius decreases constantly. This ensures a quick "unfolding" of the map at the beginning of the training process while the later training steps perform some "fine tuning" on the weights of the net.

The default learning parameters are:


Field Summary
private  int learningCycles
          The number of learning cycles to run.
private  double learningRate
           
private  org.apache.log4j.Logger log
           
private  KohonenNet net
          The net trained by this KohonenTrainer.
private  java.util.ArrayList<double[]> patterns
          The set of training patterns.
 
Constructor Summary
KohonenTrainer(KohonenNet net)
          Creates and initializes a new instance of KohonenTrainer.
 
Method Summary
 int getLearningCycles()
          Getter of the property learningCycles
 double getLearningRate()
          Getter of the property learningRate
 KohonenNet getNet()
          Getter of the property net
 java.util.ArrayList<double[]> getPatterns()
          Getter of the property patterns
 void setLearningCycles(int learningCycles)
          Setter of the property learningCycles
 void setLearningRate(double learningRate)
          Setter of the property learningRate
 void setNet(KohonenNet net)
          Setter of the property net
 void setPatterns(java.util.ArrayList<double[]> patterns)
          Setter of the property patterns
 void train()
          Controls the teaching process.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

patterns

private java.util.ArrayList<double[]> patterns
The set of training patterns.


net

private KohonenNet net
The net trained by this KohonenTrainer.


learningCycles

private int learningCycles
The number of learning cycles to run.


learningRate

private double learningRate

log

private org.apache.log4j.Logger log
Constructor Detail

KohonenTrainer

public KohonenTrainer(KohonenNet net)
Creates and initializes a new instance of KohonenTrainer.

Parameters:
net - the Kohonen map that should be trained
Method Detail

getPatterns

public java.util.ArrayList<double[]> getPatterns()
Getter of the property patterns

Returns:
Returns the patterns.

setPatterns

public void setPatterns(java.util.ArrayList<double[]> patterns)
Setter of the property patterns

Parameters:
patterns - The patterns to set.

getNet

public KohonenNet getNet()
Getter of the property net

Returns:
Returns the net.

setNet

public void setNet(KohonenNet net)
Setter of the property net

Parameters:
net - The net to set.

getLearningRate

public double getLearningRate()
Getter of the property learningRate

Returns:
Returns the learningRate.

setLearningRate

public void setLearningRate(double learningRate)
Setter of the property learningRate

Parameters:
learningRate - The learningRate to set.

getLearningCycles

public int getLearningCycles()
Getter of the property learningCycles

Returns:
Returns the learningCycles.

setLearningCycles

public void setLearningCycles(int learningCycles)
Setter of the property learningCycles

Parameters:
learningCycles - The learningCycles to set.

train

public void train()
Controls the teaching process. The neighbourhood radius of the trained Kohonen map is doubled at the beginning of the training process and then constantly decreased during training.
The set of training patterns is shuffled before each training cycle.