The Encog Project

org.encog.neural.networks.training.som
Class TrainSelfOrganizingMap

java.lang.Object
  extended by org.encog.neural.networks.training.som.TrainSelfOrganizingMap

public class TrainSelfOrganizingMap
extends java.lang.Object

TrainSelfOrganizingMap: Implements an unsupervised training algorithm for use with a Self Organizing Map.


Nested Class Summary
static class TrainSelfOrganizingMap.LearningMethod
          The learning method, either additive or subtractive.
 
Field Summary
static double DEFAULT_REDUCTION
          The default reduction to use.
static double MIN_LEARNRATE_FOR_REDUCTION
          The minimum learning rate for reduction to be applied.
 
Constructor Summary
TrainSelfOrganizingMap(BasicNetwork network, NeuralDataSet train, TrainSelfOrganizingMap.LearningMethod learnMethod, double learnRate)
          Construct the trainer for a self organizing map.
 
Method Summary
protected  void adjustWeights()
          Adjust the weights and allow the network to learn.
 void evaluateErrors()
          Evaludate the current error level of the network.
protected  void forceWin()
          Force a win, if no neuron won.
 double getBestError()
          Get the best error so far.
 double getTotalError()
          Get the error for this iteration.
 void initialize()
          Called to initialize the SOM.
 void iteration()
          This method is called for each training iteration.
protected  void normalizeWeight(Matrix matrix, int row)
          Normalize the specified row in the weight matrix.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_REDUCTION

public static final double DEFAULT_REDUCTION
The default reduction to use.

See Also:
Constant Field Values

MIN_LEARNRATE_FOR_REDUCTION

public static final double MIN_LEARNRATE_FOR_REDUCTION
The minimum learning rate for reduction to be applied.

See Also:
Constant Field Values
Constructor Detail

TrainSelfOrganizingMap

public TrainSelfOrganizingMap(BasicNetwork network,
                              NeuralDataSet train,
                              TrainSelfOrganizingMap.LearningMethod learnMethod,
                              double learnRate)
Construct the trainer for a self organizing map.

Parameters:
network - The network to train.
train - The training method.
learnMethod - The learning method.
learnRate - The learning rate.
Method Detail

adjustWeights

protected void adjustWeights()
Adjust the weights and allow the network to learn.


evaluateErrors

public void evaluateErrors()
Evaludate the current error level of the network.


forceWin

protected void forceWin()
Force a win, if no neuron won.


getBestError

public double getBestError()
Get the best error so far.

Returns:
The best error so far.

getTotalError

public double getTotalError()
Get the error for this iteration.

Returns:
The error for this iteration.

initialize

public void initialize()
Called to initialize the SOM.


iteration

public void iteration()
This method is called for each training iteration. Usually this method is called from inside a loop until the error level is acceptable.


normalizeWeight

protected void normalizeWeight(Matrix matrix,
                               int row)
Normalize the specified row in the weight matrix.

Parameters:
matrix - The weight matrix.
row - The row to normalize.

The Encog Project