public class Edge
extends java.lang.Object
Edges point from a downstream neuron upstream. This has been done to optimise calculation of values, but results in a slightly more ineficient backpropagation method where gradient descent is involved. Other backpropagation methods may not be hit severely by this, but it is an important consideration when designing the algorithm.
The edge's old weight is used when backpropagating
Neuron| Modifier and Type | Field and Description |
|---|---|
protected Neuron |
source
Stores a reference to the source neuron.
|
| Modifier | Constructor and Description |
|---|---|
protected |
Edge(Neuron p_source,
double p_weight)
Creates a new edge with neuron and weight.
|
| Modifier and Type | Method and Description |
|---|---|
double |
getOldWeight()
Returns the old weight, as per backpropagation.
|
Neuron |
getSource()
Retrns the target of this edge, ie the source (the neuron from which data flows unto the one which owns this Edge), but not the source of data.
|
double |
getWeight()
Returns the weight of the Edge.
|
void |
setOldWeight(double p_weight)
Set the old weight of this Edge.
|
protected void |
setWeight(double p_weight)
Sets the weight of this edge
|
protected Neuron source
setSource(Neuron)public void setOldWeight(double p_weight)
p_weight - The weight to setBackPropagationMethodpublic double getOldWeight()
public Neuron getSource()
protected void setWeight(double p_weight)
p_weight - The weight to set this edge topublic double getWeight()