org.joone.structure
Class Connection

java.lang.Object
  extended by org.joone.structure.Connection

public class Connection
extends java.lang.Object

A connection between two nodes..

Author:
mg

Field Summary
protected  double delta
          The accumulated delta of the weight.
protected  boolean fixed
          True if this is a fixed connection
protected  Node node
          The node from which this connection originates
protected  double weight
          The weight of this connection
 
Constructor Summary
Connection(Node node, double weight, boolean fixed)
          Create a new connection
 
Method Summary
 double getDelta()
          Retrieve the current delta
 Node getNode()
          Retrieve the node
 double getOutputValue(int pattern)
          Retrieve the output value of this connection.
 double getWeight()
          Retrieve the weight
 boolean isFixed()
          See if this is a fixed weight connection
 void setDelta(double delta)
          Set the delta
 void setWeight(double weight)
          Set the weight to a new value unless it is fixed
 void updateDelta(double increment)
          Add the given increment amount to the delta
 void updateWeight()
          Update the weight - if it is not fixed - by adding the internal delta to it and also resets that delta to zero afterwards.
 void updateWeight(double delta)
          Update the weight - if it is not fixed - by adding the given delta to it
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

node

protected Node node
The node from which this connection originates


weight

protected double weight
The weight of this connection


delta

protected double delta
The accumulated delta of the weight. This is a utility variable that is used during training to store the weight deltas to apply at a later stage.


fixed

protected boolean fixed
True if this is a fixed connection

Constructor Detail

Connection

public Connection(Node node,
                  double weight,
                  boolean fixed)
Create a new connection

Parameters:
node - node from which this links
weight - weight attached to the node
fixed - if true, then this weight is fixed and can not be changed
Method Detail

getNode

public Node getNode()
Retrieve the node


getWeight

public double getWeight()
Retrieve the weight


getDelta

public double getDelta()
Retrieve the current delta


isFixed

public boolean isFixed()
See if this is a fixed weight connection


getOutputValue

public double getOutputValue(int pattern)
Retrieve the output value of this connection. This is basically the input node's value at the given pattern times the current value of the weight.

Parameters:
pattern - pattern number

setWeight

public void setWeight(double weight)
Set the weight to a new value unless it is fixed


updateWeight

public void updateWeight(double delta)
Update the weight - if it is not fixed - by adding the given delta to it


updateWeight

public void updateWeight()
Update the weight - if it is not fixed - by adding the internal delta to it and also resets that delta to zero afterwards.


setDelta

public void setDelta(double delta)
Set the delta


updateDelta

public void updateDelta(double increment)
Add the given increment amount to the delta



Submit Feedback to pmarrone@users.sourceforge.net