Class KohonenUpdateAction
- java.lang.Object
 - 
- org.apache.commons.math4.neuralnet.sofm.KohonenUpdateAction
 
 
- 
- All Implemented Interfaces:
 UpdateAction
public class KohonenUpdateAction extends Object implements UpdateAction
Update formula for Kohonen's Self-Organizing Map.
Theupdatemethod modifies the featureswof the "winning" neuron and its neighbours according to the following rule:wnew = wold + α e(-d / σ) * (sample - wold)where- α is the current learning rate,
 - σ is the current neighbourhood size, and
 dis the number of links to traverse in order to reach the neuron from the winning neuron.
This class is thread-safe as long as the arguments passed to theconstructorare instances of thread-safe classes.
Each call to theupdatemethod will increment the internal counter used to compute the current values for- the learning rate, and
 - the neighbourhood size.
 
- Since:
 - 3.3
 
 
- 
- 
Constructor Summary
Constructors Constructor Description KohonenUpdateAction(DistanceMeasure distance, LearningFactorFunction learningFactor, NeighbourhoodSizeFunction neighbourhoodSize) 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetNumberOfCalls()Retrieves the number of calls to theupdatemethod.voidupdate(Network net, double[] features)Updates the network in response to the samplefeatures. 
 - 
 
- 
- 
Constructor Detail
- 
KohonenUpdateAction
public KohonenUpdateAction(DistanceMeasure distance, LearningFactorFunction learningFactor, NeighbourhoodSizeFunction neighbourhoodSize)
- Parameters:
 distance- Distance function.learningFactor- Learning factor update function.neighbourhoodSize- Neighbourhood size update function.
 
 - 
 
- 
Method Detail
- 
update
public void update(Network net, double[] features)
Updates the network in response to the samplefeatures.- Specified by:
 updatein interfaceUpdateAction- Parameters:
 net- Network.features- Training data.
 
- 
getNumberOfCalls
public long getNumberOfCalls()
Retrieves the number of calls to theupdatemethod.- Returns:
 - the current number of calls.
 
 
 - 
 
 -