public class Neuron extends java.lang.Object implements java.lang.Comparable<Neuron>, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
double |
counter
The local counter variable (e.g.
|
double |
distance
The distance between the neuron and an input signal.
|
java.util.List<Edge> |
edges
The direct connected neighbors.
|
double[] |
w
The reference vector.
|
Constructor and Description |
---|
Neuron(double[] w)
Constructor.
|
Neuron(double[] w,
double counter)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addEdge(Neuron neighbor)
Adds an edge.
|
void |
addEdge(Neuron neighbor,
int age)
Adds an edge.
|
void |
age()
Increments the age of all edges emanating from the neuron.
|
int |
compareTo(Neuron o) |
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).
|
public final double[] w
public final java.util.List<Edge> edges
public double distance
public double counter
public Neuron(double[] w)
public Neuron(double[] w, double counter)
public void update(double[] x, double eps)
x
- a signal.eps
- the learning rate.public void addEdge(Neuron neighbor)
public void addEdge(Neuron neighbor, int age)
public void removeEdge(Neuron neighbor)
public void setEdgeAge(Neuron neighbor, int age)
public void age()
public void distance(double[] x)