Neural Network Software

com.practicalstudies.neural
Class WeightedConnection

java.lang.Object
  |
  +--com.practicalstudies.neural.WeightedConnection

public class WeightedConnection
extends java.lang.Object

Represents a connection between Nodes.

A WeightedConnection has three attributes:

Given that a WeightedConnection has an explicit input-output direction, the combination of a group of WeightedConnections and Nodes forms a directed graph.

Author:
Michael Wax

Constructor Summary
WeightedConnection()
          Constructor.
WeightedConnection(Node inputNode, Node outputNode)
          Constructor which allows assignment of input and output Nodes to the connection.
 
Method Summary
 void adjustWeight()
          Called to adjust the connection weight of this connection if some learning algorithm is in place.
 Node getInputNode()
           
 double getLastWeightChange()
          Returns the last change in weight of this function during network learning.
 Node getOutputNode()
           
 double getWeight()
          Returns the weight of this connection.
 WeightAdjustmentFunction getWeightAdjustmentFunction()
           
 void randomizeWeight()
          Assign a random value to the connection weight of this connection.
 void setInputNode(Node inputNode)
           
 void setLastWeightChange(double lastWeightChange)
          Specify the last change in weight of this function.
 void setOutputNode(Node outputNode)
           
 void setWeight(double weight)
          Specify the weight of this connection.
 void setWeightAdjustmentFunction(WeightAdjustmentFunction weightAdjustmentFunction)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WeightedConnection

public WeightedConnection()

Constructor.

Calls randomizeWeight() to assign a random connection weight to the connection.


WeightedConnection

public WeightedConnection(Node inputNode,
                          Node outputNode)

Constructor which allows assignment of input and output Nodes to the connection.

Calls randomizeWeight() to assign a random connection weight to the connection.

Parameters:
inputNode - the Node which will provide input to this connection
outputNode - the Node which will receive input through this connection
Method Detail

randomizeWeight

public void randomizeWeight()
Assign a random value to the connection weight of this connection.


adjustWeight

public void adjustWeight()

Called to adjust the connection weight of this connection if some learning algorithm is in place.

The learning algorithm will be encapsulated in a WeightAdjustmentFunction as specified by setWeightAdjustmentFunction.

As an alternative to using this method, the weight may be set explicitly using the setWeight method.


getWeight

public final double getWeight()
Returns the weight of this connection.


setWeight

public final void setWeight(double weight)
Specify the weight of this connection.


getLastWeightChange

public final double getLastWeightChange()
Returns the last change in weight of this function during network learning.


setLastWeightChange

public final void setLastWeightChange(double lastWeightChange)
Specify the last change in weight of this function.


getInputNode

public Node getInputNode()

setInputNode

public void setInputNode(Node inputNode)
Parameters:
inputNode - the Node which will provide input to this connection

getOutputNode

public Node getOutputNode()

setOutputNode

public void setOutputNode(Node outputNode)
Parameters:
outputNode - the Node which will receive input through this connection

getWeightAdjustmentFunction

public WeightAdjustmentFunction getWeightAdjustmentFunction()

setWeightAdjustmentFunction

public void setWeightAdjustmentFunction(WeightAdjustmentFunction weightAdjustmentFunction)

PracticalStudies.com