org.vizzini.ai.neuralnetwork.layer
Class AbstractLayer

java.lang.Object
  extended by org.vizzini.util.AbstractBean
      extended by org.vizzini.ai.neuralnetwork.layer.AbstractLayer
All Implemented Interfaces:
Cloneable, ILayer
Direct Known Subclasses:
AbstractFunctionLayer, BinaryEncodeLayer

public abstract class AbstractLayer
extends AbstractBean
implements ILayer

Provides base functionality for a layer of a neural network.

Since:
v0.3
Version:
v0.3
Author:
Jeffrey M. Thompson

Field Summary
 
Fields inherited from class org.vizzini.util.AbstractBean
IGNORE_PROPERTIES
 
Constructor Summary
AbstractLayer()
          Construct this object.
AbstractLayer(String name, int nodeCount)
          Construct this object with the given parameters.
 
Method Summary
 void clear()
          Clear the node input and output values.
 void clearInputs()
          Clear the node input values.
 void clearOutputs()
          Clear the node output values.
 Object clone()
          Return a clone of this instance.
 boolean equals(Object object)
          Return true if the given object is equal to this.
 IActivationFunction getActivationFunction()
          Return the activation function.
 double getInput(int i)
          Return the node input value at the given index.
 int getInputCount()
          Return the input count.
 double[] getInputs()
          Return the node input values.
 int getMaxValueIndex()
          Return the index of the node with the maximum value.
 String getName()
          Return the name.
 double getOutput(int i)
          Return the node output value at the given index.
 int getOutputCount()
          Return the output count.
 double[] getOutputs()
          Return the node output values.
 int hashCode()
          Returns a hash code value for the object.
protected  void init(int nodeCount)
          Initialize using the given parameters.
 void setActivationFunction(IActivationFunction function)
          Set the activation function.
 void setInput(int i, double value)
           
protected  void setInputCount(int count)
          Set the input count.
 void setInputs(double[] inputs)
           
 void setName(String name)
          Set the name.
protected  void setOutput(int i, double value)
           
protected  void setOutputCount(int count)
          Set the output count.
protected  void setOutputs(double[] outputs)
           
 String toDetailString()
          Return a string representation of the details of this object.
 String toString()
          Return a string representation of this object.
 
Methods inherited from class org.vizzini.util.AbstractBean
appendArray, appendCollection, appendList, appendMap, compareBooleans, compareObjects, getIgnoreProperties
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.vizzini.ai.neuralnetwork.ILayer
evaluate
 

Constructor Detail

AbstractLayer

public AbstractLayer()
Construct this object.

Since:
v0.3

AbstractLayer

public AbstractLayer(String name,
                     int nodeCount)
Construct this object with the given parameters.

Parameters:
name - Name.
nodeCount - Node count.
Since:
v0.3
Method Detail

clear

public void clear()
Clear the node input and output values.

Specified by:
clear in interface ILayer
Since:
v0.3

clearInputs

public void clearInputs()
Clear the node input values.

Specified by:
clearInputs in interface ILayer
Since:
v0.3

clearOutputs

public void clearOutputs()
Clear the node output values.

Specified by:
clearOutputs in interface ILayer
Since:
v0.3

clone

public Object clone()
Return a clone of this instance.

Specified by:
clone in interface ILayer
Overrides:
clone in class Object
Since:
v0.3

equals

public boolean equals(Object object)
Return true if the given object is equal to this.

Specified by:
equals in interface ILayer
Overrides:
equals in class AbstractBean
Parameters:
object - The object to compare.
Returns:
Returns true if the objects are equal, otherwise false
Since:
v0.3

getActivationFunction

public IActivationFunction getActivationFunction()
Return the activation function.

Specified by:
getActivationFunction in interface ILayer
Since:
v0.3

getInput

public double getInput(int i)
Return the node input value at the given index.

Specified by:
getInput in interface ILayer
Parameters:
i - Index.
Since:
v0.3

getInputCount

public int getInputCount()
Return the input count.

Specified by:
getInputCount in interface ILayer
Since:
v0.3

getInputs

public double[] getInputs()
Return the node input values.

Specified by:
getInputs in interface ILayer
Since:
v0.3

getMaxValueIndex

public int getMaxValueIndex()
Return the index of the node with the maximum value.

Specified by:
getMaxValueIndex in interface ILayer
Since:
v0.3

getName

public String getName()
Return the name.

Specified by:
getName in interface ILayer
Since:
v0.3

getOutput

public double getOutput(int i)
Return the node output value at the given index.

Specified by:
getOutput in interface ILayer
Parameters:
i - Index.
Since:
v0.3

getOutputCount

public int getOutputCount()
Return the output count.

Specified by:
getOutputCount in interface ILayer
Since:
v0.3

getOutputs

public double[] getOutputs()
Return the node output values.

Specified by:
getOutputs in interface ILayer
Since:
v0.3

hashCode

public int hashCode()
Returns a hash code value for the object.

Specified by:
hashCode in interface ILayer
Overrides:
hashCode in class AbstractBean
Since:
v0.3

setActivationFunction

public void setActivationFunction(IActivationFunction function)
Set the activation function.

Specified by:
setActivationFunction in interface ILayer
Parameters:
function - Activation function.
Since:
v0.3

setInput

public void setInput(int i,
                     double value)
Specified by:
setInput in interface ILayer
Parameters:
i - Index.
value - Value.
Since:
v0.3

setInputs

public void setInputs(double[] inputs)
Specified by:
setInputs in interface ILayer
Parameters:
inputs - The inputs to set.
Since:
v0.3

setName

public void setName(String name)
Set the name.

Since:
v0.3

toDetailString

public String toDetailString()
Return a string representation of the details of this object.

Specified by:
toDetailString in interface ILayer
Since:
v0.3

toString

public String toString()
Return a string representation of this object.

Specified by:
toString in interface ILayer
Overrides:
toString in class AbstractBean
Since:
v0.3

init

protected void init(int nodeCount)
Initialize using the given parameters.

Parameters:
nodeCount - Node count.
Since:
v0.3

setInputCount

protected void setInputCount(int count)
Set the input count.

Parameters:
count - Count.
Since:
v0.3

setOutput

protected void setOutput(int i,
                         double value)
Since:
v0.3

setOutputCount

protected void setOutputCount(int count)
Set the output count.

Parameters:
count - Count.
Since:
v0.3

setOutputs

protected void setOutputs(double[] outputs)
Parameters:
outputs - The outputs to set.
Since:
v0.3


Copyright 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02