Neural Network Software

com.practicalstudies.neural
Class InputNode

java.lang.Object
  |
  +--com.practicalstudies.neural.InputNode
All Implemented Interfaces:
Node

public class InputNode
extends java.lang.Object
implements Node

Represents an input node to a network.

An InputNode returns an input datum as its output, and has no input connections. This class reflects the common view that inputs to a neural network are nodes in the network. It also simplifies programming of hidden nodes, as each hidden node, whether receiving data input directly or the output of upstream nodes, can always call the Node.getOutput() method to acquire input.

Author:
Michael Wax
See Also:
Node

Constructor Summary
InputNode()
           
 
Method Summary
 int addInputConnection(WeightedConnection inputConnection)
          As an InputNode by definition has no input connections, an attempt to call this method will result in an UnsupportedOperationException.
 int addOutputConnection(WeightedConnection outputConnection)
          Add an output connection to this node.
 void clearInputConnections()
          As an InputNode by definition has no input connections, an attempt to call this method will result in an UnsupportedOperationException.
 void clearOutputConnections()
          Remove all output connections from this node.
 WeightedConnection getInputConnection(int index)
          As an InputNode by definition has no input connections, an attempt to call this method will result in an UnsupportedOperationException.
 java.util.List getInputConnections()
          As an InputNode by definition has no input connections, returns an empty List.
 int getNumberInputConnections()
          As an InputNode by definition has no input connections, returns 0.
 int getNumberOutputConnections()
          Returns the number of output connections from this node.
 double getOutput()
          Returns an input datum.
 WeightedConnection getOutputConnection(int index)
          Return a specific output connection to this node.
 java.util.List getOutputConnections()
          Returns a List of WeightedConnections which are the output connections to this node.
 void setOutput(double output)
          Specify the value to be returned by getOutput.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InputNode

public InputNode()
Method Detail

getNumberInputConnections

public final int getNumberInputConnections()
As an InputNode by definition has no input connections, returns 0.

Specified by:
getNumberInputConnections in interface Node
Returns:
0

clearInputConnections

public final void clearInputConnections()
As an InputNode by definition has no input connections, an attempt to call this method will result in an UnsupportedOperationException.

Specified by:
clearInputConnections in interface Node
Throws:
java.lang.UnsupportedOperationException

addInputConnection

public int addInputConnection(WeightedConnection inputConnection)
As an InputNode by definition has no input connections, an attempt to call this method will result in an UnsupportedOperationException.

Specified by:
addInputConnection in interface Node
Parameters:
inputConnection - a WeightedConnection that will serve as an additional input connection to this node
Returns:
the number of input connections to this node, after the additional connection is added
Throws:
java.lang.UnsupportedOperationException

getInputConnection

public WeightedConnection getInputConnection(int index)
As an InputNode by definition has no input connections, an attempt to call this method will result in an UnsupportedOperationException.

Specified by:
getInputConnection in interface Node
Parameters:
index - the ordinal number of the input connection, based on the order in which connections were to this node
Returns:
the WeightedConnection representing the connection requested
Throws:
java.lang.UnsupportedOperationException

getInputConnections

public java.util.List getInputConnections()
As an InputNode by definition has no input connections, returns an empty List.

Specified by:
getInputConnections in interface Node
Returns:
an empty List

getNumberOutputConnections

public final int getNumberOutputConnections()
Description copied from interface: Node
Returns the number of output connections from this node.

Specified by:
getNumberOutputConnections in interface Node

clearOutputConnections

public final void clearOutputConnections()
Description copied from interface: Node
Remove all output connections from this node.

Specified by:
clearOutputConnections in interface Node

addOutputConnection

public int addOutputConnection(WeightedConnection outputConnection)
Description copied from interface: Node
Add an output connection to this node.

Specified by:
addOutputConnection in interface Node
Parameters:
outputConnection - a WeightedConnection that will serve as an additional output connection to this node
Returns:
the number of output connections to this node, after the additional connection is added

getOutputConnection

public WeightedConnection getOutputConnection(int index)
Description copied from interface: Node
Return a specific output connection to this node.

Specified by:
getOutputConnection in interface Node
Parameters:
index - the ordinal number of the output connection, based on the order in which connections were to this node
Returns:
the WeightedConnection representing the connection requested

getOutputConnections

public java.util.List getOutputConnections()
Description copied from interface: Node
Returns a List of WeightedConnections which are the output connections to this node.

Specified by:
getOutputConnections in interface Node

getOutput

public double getOutput()
Returns an input datum.

Specified by:
getOutput in interface Node
Returns:
the output of this node

setOutput

public void setOutput(double output)
Specify the value to be returned by getOutput.


PracticalStudies.com