net.openai.ai.nn.network
Class Neuron

java.lang.Object
  |
  +--net.openai.ai.nn.network.Neuron
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
BiasNeuron

public class Neuron
extends java.lang.Object
implements java.io.Serializable

Class declaration

Version:
%I%, %G%
Author:
See Also:
Serialized Form

Constructor Summary
Neuron()
          Constructor declaration
Neuron(Layer layer, long lID)
          Constructor declaration
 
Method Summary
 void addConnectionFrom(Connection connection)
          Add a connection from this neuron.
 void addConnectionTo(Connection connection)
          Add a connection to this neuron.
 void clearConnectionsFrom()
           
 void clearConnectionsTo()
           
 java.util.Vector getConnections()
          Gets all connections for this neuron..
 java.util.Vector getConnectionsFrom()
          Gets all 'from' connections for this neuron..
 java.util.Vector getConnectionsTo()
          Gets all 'to' connections for this neuron..
 Connection getConnectionTo(Neuron neuron)
          Gets a connection to a particular neuron.
 double getError()
          Gets the error for this neuron.
 long getID()
          returns the ID of this Neuron
protected  java.lang.String getIDString()
          Returns the unique Identifier for this Neuron as String
 double getInput()
          Gets the input for this neuron.
 Layer getLayer()
          returns the layer that holds this neuron
 long getLayerID()
          Method declaration
 double getOutput()
          Gets the output for this neuron.
 boolean isErrorSet()
          Returns a flag that tells whether this neuron has had the error set
 void setError(double error)
          Sets the error for this neuron.
 void setErrorFlag(boolean errorSet)
          This method primarily required for Castor
 void setID(long lID)
          Sets the ID of this Neuron
 void setInput(double input)
          Sets the input for this neuron.
 void setLayer(Layer layer)
          Sets the layer that holds this neuron
 void setOutput(double output)
          Sets the output for this neuron.
 java.lang.String toString()
          Returns a string rpresentation of the neuron.
 void updateConnectionPool()
          Updates connections based on connectionsFrom and connectionsTo.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Neuron

public Neuron()
Constructor declaration


Neuron

public Neuron(Layer layer,
              long lID)
Constructor declaration

Parameters:
layer -
lID -
Method Detail

getLayer

public Layer getLayer()
returns the layer that holds this neuron


getIDString

protected java.lang.String getIDString()
Returns the unique Identifier for this Neuron as String


setLayer

public void setLayer(Layer layer)
Sets the layer that holds this neuron


setID

public void setID(long lID)
Sets the ID of this Neuron


getID

public long getID()
returns the ID of this Neuron


getInput

public final double getInput()
Gets the input for this neuron.

Returns:
double The input for this neuron.

setInput

public final void setInput(double input)
Sets the input for this neuron.

Parameters:
input - The input to be set for this neuron.

getOutput

public final double getOutput()
Gets the output for this neuron.

Returns:
double The output for this neuron.

setOutput

public final void setOutput(double output)
Sets the output for this neuron.

Parameters:
output - The output to be set for this neuron.

updateConnectionPool

public final void updateConnectionPool()
Updates connections based on connectionsFrom and connectionsTo. Important for Castor unmarshalling process


getConnectionTo

public final Connection getConnectionTo(Neuron neuron)
Gets a connection to a particular neuron.

Parameters:
neuron - The neuron which may be connected to this neuron.
Returns:
Connection to the neuron...or null if not connected.

getConnections

public final java.util.Vector getConnections()
Gets all connections for this neuron..

Returns:
Vector All connections for this neuron.

getConnectionsTo

public final java.util.Vector getConnectionsTo()
Gets all 'to' connections for this neuron..

Returns:
Vector All connections 'to' this neuron.

getConnectionsFrom

public final java.util.Vector getConnectionsFrom()
Gets all 'from' connections for this neuron..

Returns:
Vector All connections 'from' this neuron.

addConnectionFrom

public final void addConnectionFrom(Connection connection)
Add a connection from this neuron.

Parameters:
connection - The connection to add.

addConnectionTo

public final void addConnectionTo(Connection connection)
Add a connection to this neuron.

Parameters:
connection - The connection to add.

getError

public final double getError()
Gets the error for this neuron.

Returns:
double The error for this neuron.

setError

public final void setError(double error)
Sets the error for this neuron.

Parameters:
error - The error to be set for this neuron.

isErrorSet

public final boolean isErrorSet()
Returns a flag that tells whether this neuron has had the error set

Returns:
boolean - Whether this neuron has had it's error calculated.

setErrorFlag

public final void setErrorFlag(boolean errorSet)
This method primarily required for Castor


toString

public final java.lang.String toString()
Returns a string rpresentation of the neuron.

Overrides:
toString in class java.lang.Object
Returns:
String A representation of the neuron.

getLayerID

public long getLayerID()
Method declaration

Returns:
See Also:

clearConnectionsFrom

public void clearConnectionsFrom()

clearConnectionsTo

public void clearConnectionsTo()


Copyright - 2001 OpenAI Labs. All Rights Reserved.