Package smile.vq

Class NeuralMap

java.lang.Object
smile.vq.NeuralMap
All Implemented Interfaces:
Serializable, VectorQuantizer

public class NeuralMap extends Object implements VectorQuantizer
NeuralMap is an efficient competitive learning algorithm inspired by growing neural gas and BIRCH. Like growing neural gas, NeuralMap has the ability to add and delete neurons with competitive Hebbian learning. Edges exist between neurons close to each other. Such edges are intended placeholders for localized data distribution. Such edges also help to locate distinct clusters (those clusters are not connected by edges).
See Also:
  • Field Summary Link icon

    Fields inherited from interface smile.vq.VectorQuantizer Link icon

    OUTLIER
  • Constructor Summary Link icon

    Constructors
    Constructor
    Description
    NeuralMap(double r, double epsBest, double epsNeighbor, int edgeLifetime, double beta)
    Constructor.
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    void
    clear(double eps)
    Removes staled neurons and the edges beyond lifetime.
    Returns the neurons.
    double[]
    quantize(double[] x)
    Quantize a new observation.
    void
    update(double[] x)
    Update the codebook with a new observation.

    Methods inherited from class java.lang.Object Link icon

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details Link icon

    • NeuralMap Link icon

      public NeuralMap(double r, double epsBest, double epsNeighbor, int edgeLifetime, double beta)
      Constructor.
      Parameters:
      r - the distance threshold to activate the nearest neuron of a signal.
      epsBest - the learning rate to update activated neuron.
      epsNeighbor - the learning rate to update neighbors of activated neuron.
      edgeLifetime - the maximum age of edges.
      beta - decrease the freshness of all neurons by multiply them with beta.
  • Method Details Link icon

    • update Link icon

      public void update(double[] x)
      Description copied from interface: VectorQuantizer
      Update the codebook with a new observation.
      Specified by:
      update in interface VectorQuantizer
      Parameters:
      x - a new observation.
    • neurons Link icon

      public Neuron[] neurons()
      Returns the neurons.
      Returns:
      the neurons.
    • clear Link icon

      public void clear(double eps)
      Removes staled neurons and the edges beyond lifetime. Neurons without emanating edges will be removed too.
      Parameters:
      eps - the freshness threshold of neurons. It should be a small value (e.g. 1E-7).
    • quantize Link icon

      public double[] quantize(double[] x)
      Description copied from interface: VectorQuantizer
      Quantize a new observation. Returns Optional.empty if the observation is noise.
      Specified by:
      quantize in interface VectorQuantizer
      Parameters:
      x - a new observation.
      Returns:
      the quantized vector.