Interface Neighborhood

All Superinterfaces:
Serializable

public interface Neighborhood extends 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 Type
    Method
    Description
    bubble(int radius)
    The bubble neighborhood function.
    Gaussian(double sigma, double T)
    The Gaussian neighborhood function.
    MexicanHat(double sigma, double T)
    The Mexican hat (aka Ricker wave) neighborhood function.
    double
    of(int i, int j, int t)
    Returns the changing rate of neighborhood at a given iteration.
    square(int width)
    The square neighborhood function.
    triangle(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

      static Neighborhood square(int width)
      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

      static Neighborhood bubble(int radius)
      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

      static Neighborhood triangle(double sigma, double T)
      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

      static Neighborhood Gaussian(double sigma, double T)
      The Gaussian neighborhood function.
      Parameters:
      sigma - the initial radius of neighborhood.
      T - the number of iterations.
      Returns:
      Gaussian neighborhood function.
    • MexicanHat

      static Neighborhood MexicanHat(double sigma, double T)
      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.