Interface Neighborhood
- All Superinterfaces:
Serializable
The neighborhood function for 2-dimensional lattice topology (e.g. SOM).
It determines the rate of change around the winner neuron.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Neighborhoodbubble(int radius) The bubble neighborhood function.static NeighborhoodGaussian(double sigma, double T) The Gaussian neighborhood function.static NeighborhoodMexicanHat(double sigma, double T) The Mexican hat (aka Ricker wave) neighborhood function.doubleof(int i, int j, int t) Returns the changing rate of neighborhood at a given iteration.static Neighborhoodsquare(int width) The square neighborhood function.static Neighborhoodtriangle(double sigma, double T) The triangle neighborhood function.
-
Method Details
-
of
double of(int i, int j, int t) Returns the changing rate of neighborhood at a given iteration.- Parameters:
i- the row distance of topology from the winner neuron.j- the column distance of topology from the winner neuron.t- the order number of current iteration.- Returns:
- the changing rate of neighborhood.
-
square
The square neighborhood function. The neighbors which are in given square width for both coordinates will be updated. The If width is 1, only the winning neuron will be updated. The square neighborhood function is a constant function in the defined neighborhood of the winner neuron, that is, every neuron in the neighborhood is updated the same proportion of the difference between the neuron and the presented sample vector.- Parameters:
width- the width of neighborhood.- Returns:
- the square neighborhood function.
-
bubble
The bubble neighborhood function. The neighbors which Euclidean distance is less than or equal to the radius will be updated. The bubble neighborhood function is a constant function in the defined neighborhood of the winner neuron, that is, every neuron in the neighborhood is updated the same proportion of the difference between the neuron and the presented sample vector. The bubble neighborhood function is a good compromise between the computational cost and the approximation of the Gaussian.- Parameters:
radius- the radius of neighborhood.- Returns:
- the bubble neighborhood function.
-
triangle
The triangle neighborhood function. The function decays linearly from the BMU to a set radius, serving as an efficient alternative to Gaussian function.- Parameters:
sigma- the initial radius of neighborhood.T- the number of iterations.- Returns:
- Triangle neighborhood function.
-
Gaussian
The Gaussian neighborhood function.- Parameters:
sigma- the initial radius of neighborhood.T- the number of iterations.- Returns:
- Gaussian neighborhood function.
-
MexicanHat
The Mexican hat (aka Ricker wave) neighborhood function. Mexican hat penalizes neighbors that are a little farther away from the center. If the model seeks to penalize near misses, Mexican hat function is a good choice.- Parameters:
sigma- the initial radius of neighborhood.T- the number of iterations.- Returns:
- Mexican hat neighborhood function.
-