The Encog Project

org.encog.neural.networks.training.competitive
Class CompetitiveTraining

java.lang.Object
  extended by org.encog.neural.networks.training.BasicTraining
      extended by org.encog.neural.networks.training.competitive.CompetitiveTraining
All Implemented Interfaces:
LearningRate, Train

public class CompetitiveTraining
extends BasicTraining
implements LearningRate

This class implements competitive training, which would be used in a winner-take-all neural network, such as the self organizing map (SOM). This is an unsupervised training method, no ideal data is needed on the training set. If ideal data is provided, it will be ignored. A neighborhood function is required to determine the degree to which neighboring neurons (to the winning neuron) are updated by each training iteration.

Author:
jheaton

Constructor Summary
CompetitiveTraining(BasicNetwork network, double learningRate, NeuralDataSet training, NeighborhoodFunction neighborhood)
          Create an instance of competitive training.
 
Method Summary
 double getLearningRate()
           
 NeighborhoodFunction getNeighborhood()
           
 BasicNetwork getNetwork()
          Get the current best network from the training.
 void iteration()
          Perform one training iteration.
 void setLearningRate(double rate)
          Set the learning rate.
 
Methods inherited from class org.encog.neural.networks.training.BasicTraining
addStrategy, getError, getStrategies, getTraining, postIteration, preIteration, setError, setTraining
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompetitiveTraining

public CompetitiveTraining(BasicNetwork network,
                           double learningRate,
                           NeuralDataSet training,
                           NeighborhoodFunction neighborhood)
Create an instance of competitive training.

Parameters:
network - The network to train.
learningRate - The learning rate, how much to apply per iteration.
training - The training set (unsupervised).
neighborhood - The neighborhood function to use.
Method Detail

getLearningRate

public double getLearningRate()
Specified by:
getLearningRate in interface LearningRate
Returns:
The learning rate. This was set when the object was created.

getNeighborhood

public NeighborhoodFunction getNeighborhood()
Returns:
The network neighborhood function.

getNetwork

public BasicNetwork getNetwork()
Description copied from interface: Train
Get the current best network from the training.

Specified by:
getNetwork in interface Train
Returns:
The network being trained.

iteration

public void iteration()
Perform one training iteration.

Specified by:
iteration in interface Train

setLearningRate

public void setLearningRate(double rate)
Set the learning rate. This is the rate at which the weights are changed.

Specified by:
setLearningRate in interface LearningRate
Parameters:
rate - The learning rate.

The Encog Project