org.joone.structure
Class NodesAndWeights.Node

java.lang.Object
  extended by org.joone.structure.NodesAndWeights.Node
Enclosing class:
NodesAndWeights

public class NodesAndWeights.Node
extends java.lang.Object

A node. A node sits inside a joone layer and at a given index. It is initially part of z but later on we will order z into Z and then K will be the index into Z at which this node is to be found. A node that is not an input node can be in U and all output nodes are in T. The sorted Z is indexed by K and has as its first few elements those nodes found in U - thus we can share the K index between these two sets. Nodes with initial states will be added to S. Note that we sort the nodes in Z so that nodes connected to the output layer comes first and nodes connected to the input layer comes last. In order to speed up processing, a bias node is also created and stored inside z and eventually in Z, typically in the final position in either z or Z. The bias node simply fires 1s all the time and is used to optimise the bias weight. It's derivative to anything is zero. Each node has weights attached to it. These weights carry the potential of other nodes into this one and are stored in the weights list. We are specifically interested in those weights that are firing from nodes in U and will store them in a separate list called I. Since we store the weights attached to each node inside the node itself, this then becomes the weight matrix. The matrix is generally sparse since a node is only connected to a few other nodes, and we gain some performance this way, at the cost of a lot of indexing, both here and in the weights themselves. Note that a node can potentially also have an initial state. Partly for performance reasons we access members in this class directly rather than via encapsulated messages.


Field Summary
protected  double bias
          The bias if this is a bias node
 java.util.List<NodesAndWeights.Weight> fixedWeights
          The list of unchangeable weights, also such as those coming from a direct synapse, that carry a singal into this node
 boolean hasInitialState
          True if this node has an initial state
 java.util.List<NodesAndWeights.Weight> I
          The list of weights that carry a signal into this node from a node in U
protected  int index
          The index into the layer at which this node is found
 boolean inU
          True if this node is in U, false if not
 boolean isInput
          True if this node is connected to the input layer
 boolean isOutput
          True if this node is connected to the output layer
 int K
          The node's number in Z.
protected  Layer layer
          The layer at which this node is found
protected  double maximumInitialStateMagnitude
          The initial state maximum magnitude.
 int order
          The node's order
 java.util.List<NodesAndWeights.Weight> weights
          The list of changeable weights that carry a signal into this node
 
Constructor Summary
NodesAndWeights.Node(double bias)
          Create a new bias node, typically with a bias value of 1
NodesAndWeights.Node(Layer layer, int index, int order)
          Create a new node from a joone layer and also check to see if it has a valid initial state
 
Method Summary
 void addInitialState(double delta)
          Change the initial state by adding to it, also update the state's delta
 double getDefaultState()
          Retrieve the default state of the node
 double getDerivative()
          Retrieve the derivative of the node
 double getInitialState()
          Get the initial state
 double getMaximumState()
          The maximum allowable value of a node
 double getMinimumState()
          The minimum allowable value of a node
 double getValue()
          Retrieve the current value of this node
 void setInitialState(double initialState)
          Set the initial state of the node, if any
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bias

protected double bias
The bias if this is a bias node


layer

protected Layer layer
The layer at which this node is found


index

protected int index
The index into the layer at which this node is found


K

public int K
The node's number in Z. Also its number in T and U if it is in one of these. A value of -1 indicates that it has not been allocated yet. It is really used as a sanity check and you should not have to check of -1 values.


inU

public boolean inU
True if this node is in U, false if not


isOutput

public boolean isOutput
True if this node is connected to the output layer


isInput

public boolean isInput
True if this node is connected to the input layer


hasInitialState

public boolean hasInitialState
True if this node has an initial state


order

public int order
The node's order


maximumInitialStateMagnitude

protected double maximumInitialStateMagnitude
The initial state maximum magnitude. When initial states are changed we ensure it's magnitude remains below this value.


weights

public java.util.List<NodesAndWeights.Weight> weights
The list of changeable weights that carry a signal into this node


I

public java.util.List<NodesAndWeights.Weight> I
The list of weights that carry a signal into this node from a node in U


fixedWeights

public java.util.List<NodesAndWeights.Weight> fixedWeights
The list of unchangeable weights, also such as those coming from a direct synapse, that carry a singal into this node

Constructor Detail

NodesAndWeights.Node

public NodesAndWeights.Node(double bias)
Create a new bias node, typically with a bias value of 1


NodesAndWeights.Node

public NodesAndWeights.Node(Layer layer,
                            int index,
                            int order)
Create a new node from a joone layer and also check to see if it has a valid initial state

Method Detail

getValue

public double getValue()
Retrieve the current value of this node


getDerivative

public double getDerivative()
Retrieve the derivative of the node


getMinimumState

public double getMinimumState()
The minimum allowable value of a node


getMaximumState

public double getMaximumState()
The maximum allowable value of a node


getDefaultState

public double getDefaultState()
Retrieve the default state of the node


setInitialState

public void setInitialState(double initialState)
Set the initial state of the node, if any


getInitialState

public double getInitialState()
Get the initial state


addInitialState

public void addInitialState(double delta)
Change the initial state by adding to it, also update the state's delta



Submit Feedback to pmarrone@users.sourceforge.net