org.shapelogic.machinelearning
Class FFNeuralNetwork

java.lang.Object
  extended by org.shapelogic.machinelearning.FFNeuralNetwork
All Implemented Interfaces:
Calc1<double[],double[]>

public class FFNeuralNetwork
extends java.lang.Object
implements Calc1<double[],double[]>

Feed Forward Neural Network with external training.
The bias is considered the zeroth element of the synaptic weight.

Author:
Sami Badawi

Field Summary
protected  int _biasWeight
          There is not agreement about whether the bias should be 1 or -1.

In Joone it seems to be 1, so for now it is set to 1 here.
protected  java.util.ArrayList<java.lang.Integer> _layerNodes
           
protected  java.util.ArrayList<double[]> _layerWeights
           
protected  java.lang.String _message
           
 int nInputNodes
           
 int nOutputNodes
           
 
Constructor Summary
FFNeuralNetwork(int nInput, int nOutput)
           
 
Method Summary
 boolean addLayer(double[] layer)
           
 boolean addLayers(double[][] layers)
           
 double[] calcLayer(double[] lastResult, int layerNumber)
           
 java.util.ArrayList<java.lang.Integer> getLayerNodes()
           
 int getLayerNodesInTopLayer()
           
 java.util.ArrayList<double[]> getLayerWeights()
           
 java.lang.String getMessage()
           
 double[] invoke(double[] input)
           
 double transform(double input)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nInputNodes

public final int nInputNodes

nOutputNodes

public final int nOutputNodes

_layerNodes

protected java.util.ArrayList<java.lang.Integer> _layerNodes

_layerWeights

protected java.util.ArrayList<double[]> _layerWeights

_message

protected java.lang.String _message

_biasWeight

protected int _biasWeight
There is not agreement about whether the bias should be 1 or -1.

In Joone it seems to be 1, so for now it is set to 1 here.

It might be changed to be ajudstable.

Constructor Detail

FFNeuralNetwork

public FFNeuralNetwork(int nInput,
                       int nOutput)
Method Detail

invoke

public double[] invoke(double[] input)
Specified by:
invoke in interface Calc1<double[],double[]>

calcLayer

public double[] calcLayer(double[] lastResult,
                          int layerNumber)

addLayer

public boolean addLayer(double[] layer)

addLayers

public boolean addLayers(double[][] layers)

transform

public double transform(double input)

getLayerNodes

public java.util.ArrayList<java.lang.Integer> getLayerNodes()

getLayerNodesInTopLayer

public int getLayerNodesInTopLayer()

getLayerWeights

public java.util.ArrayList<double[]> getLayerWeights()

getMessage

public java.lang.String getMessage()


Copyright © 2009. All Rights Reserved.