|
The Encog Project | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.encog.neural.networks.training.BasicTraining
org.encog.neural.networks.training.competitive.CompetitiveTraining
public class CompetitiveTraining
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. Training is done by looping over all of the training elements and calculating a "best matching unit" (BMU). This BMU output neuron is then adjusted to better "learn" this pattern. Additionally, this training may be applied to othr "nearby" output neurons. The degree to which nearby neurons are update is defined by the neighborhood function. A neighborhood function is required to determine the degree to which neighboring neurons (to the winning neuron) are updated by each training iteration. Because this is unsupervised training, calculating an error to measure progress by is difficult. The error is defined to be the "worst", or longest, Euclidean distance of any of the BMU's. This value should be minimized, as learning progresses. Because only the BMU neuron and its close neighbors are updated, you can end up with some output neurons that learn nothing. By default these neurons are forced to win patterns that are not represented well. This spreads out the workload among all output neurons. This feature is used by default, but can be disabled by setting the "forceWinner" property.
| Constructor Summary | |
|---|---|
CompetitiveTraining(BasicNetwork network,
double learningRate,
NeuralDataSet training,
NeighborhoodFunction neighborhood)
Create an instance of competitive training. |
|
| Method Summary | |
|---|---|
int |
getInputNeuronCount()
|
double |
getLearningRate()
|
NeighborhoodFunction |
getNeighborhood()
|
BasicNetwork |
getNetwork()
Get the current best network from the training. |
int |
getOutputNeuronCount()
|
boolean |
isForceWinner()
|
void |
iteration()
Perform one training iteration. |
void |
setForceWinner(boolean forceWinner)
Determine if a winner is to be forced. |
void |
setLearningRate(double rate)
Set the learning rate. |
| Methods inherited from class org.encog.neural.networks.training.BasicTraining |
|---|
addStrategy, finishTraining, 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 |
|---|
public CompetitiveTraining(BasicNetwork network,
double learningRate,
NeuralDataSet training,
NeighborhoodFunction neighborhood)
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 |
|---|
public int getInputNeuronCount()
public double getLearningRate()
getLearningRate in interface LearningRatepublic NeighborhoodFunction getNeighborhood()
public BasicNetwork getNetwork()
Train
getNetwork in interface Trainpublic int getOutputNeuronCount()
public boolean isForceWinner()
public void iteration()
iteration in interface Trainpublic void setForceWinner(boolean forceWinner)
forceWinner - True if a winner is to be forced.public void setLearningRate(double rate)
setLearningRate in interface LearningRaterate - The learning rate.
|
The Encog Project | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||