org.vizzini.ai.neuralnetwork
Class AbstractConnector

java.lang.Object
  extended by org.vizzini.util.AbstractBean
      extended by org.vizzini.ai.neuralnetwork.AbstractConnector
All Implemented Interfaces:
Cloneable, IConnector
Direct Known Subclasses:
Connector

abstract class AbstractConnector
extends AbstractBean
implements IConnector

Provides base functionality for connectors between layers in 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
AbstractConnector(ILayer fromLayer, ILayer toLayer)
          Construct this object with the given parameters.
 
Method Summary
 Object clone()
          Return a clone of this instance.
 boolean equals(Object object)
          Return true if the given object is equal to this.
 void fillWeights(double value)
          Assign the given value to all weights.
 ILayer getFromLayer()
          Return the from layer.
 ILayer getToLayer()
          Return the to layer.
 double getWeight(int i, int j)
          Return the weight for the given parameters.
 int getWeightCount()
          Return a count of the weights.
protected  double[][] getWeights()
          Return the weights for the given parameters.
 double[] getWeights(int i)
          Return the weights for the given parameters.
 void randomizeWeights()
          Assign random weights to the neural network in [-0.1,0.1].
 void randomizeWeights(double range)
          Assign random weights to the neural network.
protected  void setFromLayer(ILayer fromLayer)
           
protected  void setToLayer(ILayer toLayer)
           
 void setWeight(int i, int j, double weight)
          Set the weight for the given parameters.
protected  void setWeights(double[][] weights)
          Set the weights.
 String toString()
          Return a string representation of this object.
 void zeroWeights()
          Assign zero weights.
 
Methods inherited from class org.vizzini.util.AbstractBean
appendArray, appendCollection, appendList, appendMap, compareBooleans, compareObjects, getIgnoreProperties, hashCode
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.vizzini.ai.neuralnetwork.IConnector
adjustWeights, hashCode
 

Constructor Detail

AbstractConnector

public AbstractConnector(ILayer fromLayer,
                         ILayer toLayer)
Construct this object with the given parameters.

Parameters:
fromLayer - From layer.
toLayer - To layer.
Since:
v0.3
Method Detail

clone

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

Specified by:
clone in interface IConnector
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 IConnector
Overrides:
equals in class AbstractBean
Parameters:
object - The object to compare.
Returns:
Returns true if the objects are equal, otherwise false
Since:
v0.3

fillWeights

public void fillWeights(double value)
Assign the given value to all weights.

Specified by:
fillWeights in interface IConnector
Since:
v0.3

getFromLayer

public ILayer getFromLayer()
Description copied from interface: IConnector
Return the from layer.

Specified by:
getFromLayer in interface IConnector
Returns:
Return fromLayer.
Since:
v0.3

getToLayer

public ILayer getToLayer()
Description copied from interface: IConnector
Return the to layer.

Specified by:
getToLayer in interface IConnector
Returns:
Return toLayer.
Since:
v0.3

getWeight

public double getWeight(int i,
                        int j)
Return the weight for the given parameters.

Specified by:
getWeight in interface IConnector
Parameters:
i - From layer node index.
j - To layer node index.
Since:
v0.3

getWeightCount

public int getWeightCount()
Return a count of the weights.

Specified by:
getWeightCount in interface IConnector
Since:
v0.3

getWeights

public double[] getWeights(int i)
Return the weights for the given parameters.

Specified by:
getWeights in interface IConnector
Parameters:
i - From layer node index.
Since:
v0.3

randomizeWeights

public void randomizeWeights()
Assign random weights to the neural network in [-0.1,0.1].

Specified by:
randomizeWeights in interface IConnector
Since:
v0.3

randomizeWeights

public void randomizeWeights(double range)
Assign random weights to the neural network.

Specified by:
randomizeWeights in interface IConnector
Parameters:
range - ±Range of random weights around zero.
Since:
v0.3

setWeight

public void setWeight(int i,
                      int j,
                      double weight)
Set the weight for the given parameters.

Specified by:
setWeight in interface IConnector
Parameters:
i - From layer node index.
j - To layer node index.
weight - New weight.
Since:
v0.3

toString

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

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

zeroWeights

public void zeroWeights()
Assign zero weights.

Specified by:
zeroWeights in interface IConnector
Since:
v0.3

getWeights

protected double[][] getWeights()
Return the weights for the given parameters.

Since:
v0.3

setFromLayer

protected void setFromLayer(ILayer fromLayer)
Parameters:
fromLayer - The fromLayer to set.
Since:
v0.3

setToLayer

protected void setToLayer(ILayer toLayer)
Parameters:
toLayer - The toLayer to set.
Since:
v0.3

setWeights

protected void setWeights(double[][] weights)
Set the weights.

Since:
v0.3


Copyright © 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02