Package smile.vq.hebb
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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds an edge.void
Adds an edge.void
age()
Increments the age of all edges emanating from the neuron.int
void
distance
(double[] x) Computes the distance between the neuron and a signal.void
removeEdge
(Neuron neighbor) Removes an edge.void
setEdgeAge
(Neuron neighbor, int age) Sets the age of edge.void
update
(double[] x, double eps) Updates the reference vector by w += eps * (x - w).
-
Field Details
-
w
public final double[] wThe reference vector. -
edges
The direct connected neighbors. -
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
Adds an edge.- Parameters:
neighbor
- the neighbor neuron.
-
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:
compareTo
in interfaceComparable<Neuron>
-