update method modifies the
features w of the "winning" neuron and its neighbours
according to the following rule:
wnew = wold + α e(-d / σ) * (sample - wold)
where
d is the number of links to traverse in order to reach
the neuron from the winning neuron.constructor are instances of thread-safe
classes.
update method
will increment the internal counter used to compute the current
values for
| Modifier and Type | Field and Description |
|---|---|
| private final DistanceMeasure | distance
Distance function. |
| private final LearningFactorFunction | learningFactor
Learning factor update function. |
| private final NeighbourhoodSizeFunction | neighbourhoodSize
Neighbourhood size update function. |
| private final AtomicLong | numberOfCalls
Number of calls to |
| Access | Constructor and Description |
|---|---|
| public | KohonenUpdateAction(DistanceMeasure
Distance function. distance, LearningFactorFunction Learning factor update function. learningFactor, NeighbourhoodSizeFunction Neighbourhood size update function. neighbourhoodSize)
|
| Modifier and Type | Method and Description |
|---|---|
| private boolean | Returns: true if the update succeeded, true if a
concurrent update has been detected.Neuron to be updated. n, double[] Training data. features, double Learning factor. learningRate)Tries to update a neuron. |
| private double[] | Returns: the new values for the features.Current values of the features. current, double[] Training data. sample, double Learning factor. learningRate)Computes the new value of the features set. |
| private Neuron | Returns: the winning neuron.Network. net, double[] Sample data. features, double Current learning factor. learningRate)Searches for the neuron whose features are closest to the given sample, and atomically updates its features. |
| public long | Returns: the current number of calls.Retrieves the number of calls to the |
| public void | update(Network
Network. net, double[] Training data. features)Implements org. Updates the network in response to the sample |
| private void | updateNeighbouringNeuron(Neuron
Neuron to be updated. n, double[] Training data. features, double Learning factor. learningRate)Atomically updates the given neuron. |
| distance | back to summary |
|---|---|
| private final DistanceMeasure distance Distance function. | |
| learningFactor | back to summary |
|---|---|
| private final LearningFactorFunction learningFactor Learning factor update function. | |
| neighbourhoodSize | back to summary |
|---|---|
| private final NeighbourhoodSizeFunction neighbourhoodSize Neighbourhood size update function. | |
| numberOfCalls | back to summary |
|---|---|
| private final AtomicLong numberOfCalls Number of calls to | |
| KohonenUpdateAction | back to summary |
|---|---|
public KohonenUpdateAction(DistanceMeasure distance, LearningFactorFunction learningFactor, NeighbourhoodSizeFunction neighbourhoodSize)
| |
| attemptNeuronUpdate | back to summary |
|---|---|
| private boolean attemptNeuronUpdate(Neuron n, double[] features, double learningRate) Tries to update a neuron.
| |
| computeFeatures | back to summary |
|---|---|
| private double[] computeFeatures(double[] current, double[] sample, double learningRate) Computes the new value of the features set.
| |
| findAndUpdateBestNeuron | back to summary |
|---|---|
| private Neuron findAndUpdateBestNeuron(Network net, double[] features, double learningRate) Searches for the neuron whose features are closest to the given sample, and atomically updates its features. | |
| getNumberOfCalls | back to summary |
|---|---|
| public long getNumberOfCalls() Retrieves the number of calls to the
| |
| update | back to summary |
|---|---|
| public void update(Network net, double[] features) Implements org. Doc from org. Updates the network in response to the sample
| |
| updateNeighbouringNeuron | back to summary |
|---|---|
| private void updateNeighbouringNeuron(Neuron n, double[] features, double learningRate) Atomically updates the given neuron.
| |