public class ReceptiveNeuron extends java.lang.Object implements Neuron
| Modifier and Type | Field and Description |
|---|---|
protected double |
delta
Stores the last value correction as per the backpropagation algorithm
|
protected Edge[] |
edges
Retains all Edges for this node.
|
| Constructor and Description |
|---|
ReceptiveNeuron(Edge[] p_inputEdges,
ThresholdingAlgorithm p_thresholdModel)
Creates a Neuron with Edges from an array.
|
ReceptiveNeuron(ThresholdingAlgorithm p_thresholdModel)
Creates a new neuron with no edges.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addEdge(Edge p_edge)
Adds a single edge to the neuron.
|
void |
addEdges(Neuron[] p_neuronList)
Constructs randomly weighted edges to all neurons in the array provided.
|
void |
calculateValue()
pre-calculates the value of this neuron - this method requires that all previous layers have been run first in a feed-forward manner.
|
int |
countEdges()
Returns the number of edges currently in this neuron.
|
double |
differentialValue()
Returns the differential of the function that generates value at this point.
|
double |
getDelta()
Returns the last error value from backpropagation.
|
Edge |
getEdge(int p_index)
Returns an edge at the index given.
|
Edge[] |
getInputEdges()
Returns a list of all edges handled by this Neuron
|
boolean |
isPresent(Edge p_edge)
checks if an Edge is held in this layer.
|
void |
prune(double p_threshold)
Removes Edges with an absolute weight under the threshold given.
|
void |
removeEdge(Edge p_edge)
Removes an edge from this neuron.
|
void |
removeEdge(int p_index)
Removes an edge from the layer by index.
|
void |
setDelta(double p_delta)
Sets the difference between current value and desired value during the backpropagation process.
|
void |
setEdgeWeight(int p_index,
double p_weight)
Sets the weight of an edge, as indexed by the connection to the current Neuron.
|
double |
value()
Returns the sum of all Edge values, multiplied by their weight.
|
protected Edge[] edges
protected double delta
public ReceptiveNeuron(ThresholdingAlgorithm p_thresholdModel)
p_thresholdModel - The thresholding algorithm to usepublic ReceptiveNeuron(Edge[] p_inputEdges, ThresholdingAlgorithm p_thresholdModel)
p_inputEdges - An array of edges to attach to the Neuronp_thresholdModel - The thresholding algorithm model to usepublic void addEdges(Neuron[] p_neuronList)
p_neuronList - An array of neurons to create edges topublic double getDelta()
public void setDelta(double p_delta)
p_delta - The delta value chosen for this neuronpublic void setEdgeWeight(int p_index,
double p_weight)
throws IndexOutOfBoundsException
p_index - The index of the Edge of which to edit the weight.p_weight - The weight to set the Edge to.IndexOutOfBoundsException - in the event that the index given is not linked to an edge.public void addEdge(Edge p_edge)
p_edge - The edge to add.public void removeEdge(Edge p_edge) throws ItemNotFoundException
p_edge - The edge to remove.ItemNotFoundExceptionpublic void prune(double p_threshold)
p_threshold - The weighting under which to remove an Edgepublic void removeEdge(int p_index)
throws IndexOutOfBoundsException
p_index - The index of the edge to removeIndexOutOfBoundsException - in the event that the index given is out of range.public int countEdges()
public Edge[] getInputEdges()
public double value()
public double differentialValue()
public void calculateValue()
public Edge getEdge(int p_index) throws IndexOutOfBoundsException
p_index - the index of the Edge to returnIndexOutOfBoundsException - in the event that the index given is invalid.public boolean isPresent(Edge p_edge)
p_edge - The edge to check for