Class Neuron
java.lang.Object
smile.vq.hebb.Neuron
- All Implemented Interfaces:
Serializable, Comparable<Neuron>
The neuron vertex in the growing neural gas network.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds an edge.voidAdds an edge.voidage()Increments the age of all edges emanating from the neuron.intvoiddistance(double[] x) Computes the distance between the neuron and a signal.voidremoveEdge(Neuron neighbor) Removes an edge.voidsetEdgeAge(Neuron neighbor, int age) Sets the age of edge.voidupdate(double[] x, double eps) Updates the reference vector by w += eps * (x - w).
-
Field Details
-
w
public final double[] wThe reference vector. -
edges
-
distance
public transient double distanceThe distance between the neuron and an input signal. -
counter
public double counterThe local counter variable (e.g. the accumulated error, freshness, etc.)
-
-
Constructor Details
-
Neuron
public Neuron(double[] w) Constructor.- Parameters:
w- the reference vector.
-
Neuron
public Neuron(double[] w, double counter) Constructor.- Parameters:
w- the reference vector.counter- the local counter.
-
-
Method Details
-
update
public void update(double[] x, double eps) Updates the reference vector by w += eps * (x - w).- Parameters:
x- a signal.eps- the learning rate.
-
addEdge
-
addEdge
Adds an edge.- Parameters:
neighbor- the neighbor neuron.age- the age of edge.
-
removeEdge
Removes an edge.- Parameters:
neighbor- the neighbor neuron of the edge.
-
setEdgeAge
Sets the age of edge.- Parameters:
neighbor- the neighbor neuron of the edge.age- the age of edge.
-
age
public void age()Increments the age of all edges emanating from the neuron. -
distance
public void distance(double[] x) Computes the distance between the neuron and a signal.- Parameters:
x- the signal.
-
compareTo
- Specified by:
compareToin interfaceComparable<Neuron>
-