smile.vq
Class GrowingNeuralGas
- java.lang.Object
-
- smile.vq.GrowingNeuralGas
-
- All Implemented Interfaces:
- Clustering<double[]>
public class GrowingNeuralGas extends java.lang.Object implements Clustering<double[]>
Growing Neural Gas. As an extension of Neural Gas, Growing Neural Gas can add and delete nodes during algorithm execution. The growth mechanism is based on growing cell structures and competitive Hebbian learning.Compared to Neural Gas, GNG has the following distinctions:
- The system has the ability to add and delete nodes.
- Local Error measurements are noted at each step helping it to locally insert/delete nodes.
- Edges are connected between nodes, so a sufficiently old edges is deleted. 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).
References
- B. Fritzke. A growing neural gas network learns topologies. NIPS, 1995.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static classGrowingNeuralGas.NeuronThe neuron vertex in the growing neural gas network.
-
Field Summary
-
Fields inherited from interface smile.clustering.Clustering
OUTLIER
-
-
Constructor Summary
Constructors Constructor and Description GrowingNeuralGas(int d)Constructor.GrowingNeuralGas(int d, double epsBest, double epsNeighbor, int maxEdgeAge, int lambda, double alpha, double beta)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description GrowingNeuralGas.Neuron[]neurons()Returns the neurons in the network.voidpartition(int k)Clustering neurons into k clusters.intpredict(double[] x)Cluster a new instance to the nearest neuron.voidupdate(double[] x)Update the Neural Gas with a new signal.
-
-
-
Constructor Detail
-
GrowingNeuralGas
public GrowingNeuralGas(int d)
Constructor.- Parameters:
d- the dimensionality of signals.
-
GrowingNeuralGas
public GrowingNeuralGas(int d, double epsBest, double epsNeighbor, int maxEdgeAge, int lambda, double alpha, double beta)Constructor.- Parameters:
d- the dimensionality of signals.epsBest- the fraction to update nearest neuron.epsNeighbor- the fraction to update neighbors of nearest neuron.maxEdgeAge- the maximum age of edges.lambda- if the number of input signals so far is an integer multiple of lambda, insert a new neuron.alpha- decrease error variables by multiplying them with alpha during inserting a new neuron.beta- decrease all error variables by multiply them with beta.
-
-
Method Detail
-
neurons
public GrowingNeuralGas.Neuron[] neurons()
Returns the neurons in the network.- Returns:
- the neurons in the network.
-
update
public void update(double[] x)
Update the Neural Gas with a new signal.
-
partition
public void partition(int k)
Clustering neurons into k clusters.- Parameters:
k- the number of clusters.
-
predict
public int predict(double[] x)
Cluster a new instance to the nearest neuron.- Specified by:
predictin interfaceClustering<double[]>- Parameters:
x- a new instance.- Returns:
- the cluster label. If the method partition() was called, this is the cluster id of nearest neuron. Otherwise, it is just the index of neuron.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG