C# Класс Encog.Neural.Networks.Training.Competitive.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.
Наследование: BasicTraining, ILearningRate
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
AutoDecay ( ) : void

Should be called each iteration if autodecay is desired.

CompetitiveTraining ( BasicNetwork network, double learningRate, INeuralDataSet training, INeighborhoodFunction neighborhood ) : log4net

Create an instance of competitive training.

Decay ( double d ) : void

Called to decay the learning rate and radius by the specified amount.

Decay ( double decayRate, double decayRadius ) : void

Decay the learning rate and radius by the specified amount.

Iteration ( ) : void

Perform one training iteration.

SetAutoDecay ( int plannedIterations, double startRate, double endRate, double startRadius, double endRadius ) : void

Setup autodecay. This will decrease the radius and learning rate from the start values to the end values.

SetParams ( double rate, double radius ) : void

Set the learning rate and radius.

ToString ( ) : String

Returns this object as a string.

TrainPattern ( INeuralData pattern ) : void

Train the specified pattern. Find a winning neuron and adjust all neurons according to the neighborhood function.

Приватные методы

Метод Описание
ApplyCorrection ( ) : void

Loop over the synapses to be trained and apply any corrections that were determined by this training iteration.

CopyInputPattern ( ISynapse synapse, int outputNeuron, INeuralData input ) : void

Copy the specified input pattern to the weight matrix. This causes an output neuron to learn this pattern "exactly". This is useful when a winner is to be forced.

DetermineNewWeight ( double weight, double input, int currentNeuron, int bmu ) : double

Determine the weight adjustment for a single neuron during a training iteration.

ForceWinners ( ISynapse synapse, int won, INeuralData leastRepresented ) : bool

Force any neurons that did not win to off-load patterns from overworked neurons.

Train ( int bmu, ISynapse synapse, INeuralData input ) : void

Train for the specified synapse and BMU.

TrainPattern ( ISynapse synapse, INeuralData input, int current, int bmu ) : void

Train for the specified pattern.

Описание методов

AutoDecay() публичный Метод

Should be called each iteration if autodecay is desired.
public AutoDecay ( ) : void
Результат void

CompetitiveTraining() публичный Метод

Create an instance of competitive training.
public CompetitiveTraining ( BasicNetwork network, double learningRate, INeuralDataSet training, INeighborhoodFunction neighborhood ) : log4net
network BasicNetwork The network to train.
learningRate double The learning rate, how much to apply per iteration.
training INeuralDataSet The training set (unsupervised).
neighborhood INeighborhoodFunction The neighborhood function to use.
Результат log4net

Decay() публичный Метод

Called to decay the learning rate and radius by the specified amount.
public Decay ( double d ) : void
d double The percent to decay by.
Результат void

Decay() публичный Метод

Decay the learning rate and radius by the specified amount.
public Decay ( double decayRate, double decayRadius ) : void
decayRate double The percent to decay the learning rate by.
decayRadius double The percent to decay the radius by.
Результат void

Iteration() публичный Метод

Perform one training iteration.
public Iteration ( ) : void
Результат void

SetAutoDecay() публичный Метод

Setup autodecay. This will decrease the radius and learning rate from the start values to the end values.
public SetAutoDecay ( int plannedIterations, double startRate, double endRate, double startRadius, double endRadius ) : void
plannedIterations int The number of iterations that are planned. /// This allows the decay rate to be determined.
startRate double The starting learning rate.
endRate double The ending learning rate.
startRadius double The starting radius.
endRadius double The ending radius.
Результат void

SetParams() публичный Метод

Set the learning rate and radius.
public SetParams ( double rate, double radius ) : void
rate double The new learning rate.
radius double The new radius.
Результат void

ToString() публичный Метод

Returns this object as a string.
public ToString ( ) : String
Результат String

TrainPattern() публичный Метод

Train the specified pattern. Find a winning neuron and adjust all neurons according to the neighborhood function.
public TrainPattern ( INeuralData pattern ) : void
pattern INeuralData The pattern to train.
Результат void