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 place holders for localized data distribution. Such edges also help to locate distinct clusters (those clusters are not connected by edges).
See Also:
  • Field Summary

    Fields inherited from interface smile.vq.VectorQuantizer

    OUTLIER
  • Constructor Summary

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

    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

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

    • NeuralMap

      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

    • update

      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

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

      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

      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.