C# Класс AForge.Neuro.Learning.SOMLearning

Kohonen Self Organizing Map (SOM) learning algorithm.

This class implements Kohonen's SOM learning algorithm and is widely used in clusterization tasks. The class allows to train Distance Networks.

Sample usage (clustering RGB colors):

// set range for randomization neurons' weights Neuron.RandRange = new Range( 0, 255 ); // create network DistanceNetwork network = new DistanceNetwork( 3, // thress inputs in the network 100 * 100 ); // 10000 neurons // create learning algorithm SOMLearning trainer = new SOMLearning( network ); // network's input double[] input = new double[3]; // loop while ( !needToStop ) { input[0] = rand.Next( 256 ); input[1] = rand.Next( 256 ); input[2] = rand.Next( 256 ); trainer.Run( input ); // ... // update learning rate and radius continuously, // so networks may come steady state }
Наследование: IUnsupervisedLearning
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
Run ( double input ) : double

Runs learning iteration.

The method runs one learning iterations - finds winner neuron (the neuron which has weights with values closest to the specified input vector) and updates its weight (as well as weights of neighbor neurons) in the way to decrease difference with the specified input vector.

RunEpoch ( double input ) : double

Runs learning epoch.

The method runs one learning epoch, by calling Run method for each vector provided in the input array.

SOMLearning ( DistanceNetwork network ) : System

Initializes a new instance of the SOMLearning class.

This constructor supposes that a square network will be passed for training - it should be possible to get square root of network's neurons amount.

SOMLearning ( DistanceNetwork network, int width, int height ) : System

Initializes a new instance of the SOMLearning class.

The constructor allows to pass network of arbitrary rectangular shape. The amount of neurons in the network should be equal to width * height.

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

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

Runs learning iteration.

The method runs one learning iterations - finds winner neuron (the neuron which has weights with values closest to the specified input vector) and updates its weight (as well as weights of neighbor neurons) in the way to decrease difference with the specified input vector.

public Run ( double input ) : double
input double Input vector.
Результат double

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

Runs learning epoch.

The method runs one learning epoch, by calling Run method for each vector provided in the input array.

public RunEpoch ( double input ) : double
input double Array of input vectors.
Результат double

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

Initializes a new instance of the SOMLearning class.

This constructor supposes that a square network will be passed for training - it should be possible to get square root of network's neurons amount.

Invalid network size - square network is expected.
public SOMLearning ( DistanceNetwork network ) : System
network DistanceNetwork Neural network to train.
Результат System

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

Initializes a new instance of the SOMLearning class.
The constructor allows to pass network of arbitrary rectangular shape. The amount of neurons in the network should be equal to width * height.
Invalid network size - network size does not correspond /// to specified width and height.
public SOMLearning ( DistanceNetwork network, int width, int height ) : System
network DistanceNetwork Neural network to train.
width int Neural network's width.
height int Neural network's height.
Результат System