yawn.nn.mlp
Class MultiLayerPerceptron

java.lang.Object
  extended by yawn.nn.NeuralNetwork
      extended by yawn.nn.mlp.MultiLayerPerceptron
All Implemented Interfaces:
java.io.Serializable

public class MultiLayerPerceptron
extends NeuralNetwork

A multi-layer perceptron with backpropagation of errors learning. $Id: MultiLayerPerceptron.java,v 1.8 2005/04/07 17:28:07 supermarti Exp $

Version:
$Revision: 1.8 $
Author:
Luis Martí (luis dot marti at uc3m dot es)
See Also:
Serialized Form

Field Summary
protected  MultiLayerPerceptronConfig config
           
protected  long currentEpoch
           
protected  double errorSum
           
protected  java.util.List layers
           
protected  double learningRate
           
protected  long maxEpochs
           
protected  double momentumRate
           
protected  double predictionError
           
 
Constructor Summary
MultiLayerPerceptron()
           
 
Method Summary
 void addLayer(int index, MLPLayer element)
           
 void addLayer(MLPLayer layer)
           
 MultiLayerPerceptron copy()
           
 int getInputSize()
           
 MLPLayer getLayer(int i)
           
 java.util.List getLayers()
           
 double getLearningRate()
           
 long getMaxEpochs()
           
 double getMomentumRate()
           
 java.lang.String getNeuralNetworkName()
          Returns a human readable
 int getOutputSize()
           
 double getPredictionError()
           
protected  void init()
           
 int layersCount()
           
 java.util.Iterator layersIterator()
           
 java.util.ListIterator layersListIterator()
           
 void oneLearningStep(Pattern input, Pattern output)
          Implements a learning iteration as: propagates the input storing the activation of all nodes; sums in errorSum the mean square error of the prediction; calculation of the deltas; backpropagation of errors, and; weights update.
 Pattern predict(Pattern input)
          Computes a network prediction
 void removeLayer(int index)
           
 void setLayers(java.util.List layers)
           
 void setLearningRate(double learningRate)
           
 void setMaxEpochs(long maxEpochs)
           
 void setMomentumRate(double momentumRate)
           
 void setPredictionError(double predictionError)
           
 void setup(NeuralNetworkConfig config)
           
 void train(InputOutputPattern[] iop)
          Trains the network until the stop criteria is met.
 NeuralNetworkConfig yieldConfiguration()
           
 
Methods inherited from class yawn.nn.NeuralNetwork
getAdapting, getStatisticsFacility, isAdapting, setAdapting, setStatisticsFacility
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentEpoch

protected long currentEpoch

errorSum

protected double errorSum

layers

protected java.util.List layers

learningRate

protected double learningRate

momentumRate

protected double momentumRate

maxEpochs

protected long maxEpochs

predictionError

protected double predictionError

config

protected MultiLayerPerceptronConfig config
Constructor Detail

MultiLayerPerceptron

public MultiLayerPerceptron()
Method Detail

addLayer

public void addLayer(int index,
                     MLPLayer element)
Parameters:
index - index of insertion
element - the layer to add
See Also:
List.add(int, Object)

addLayer

public void addLayer(MLPLayer layer)
Parameters:
layer - The layer to add.

getLayer

public MLPLayer getLayer(int i)

getLayers

public java.util.List getLayers()
Returns:
Returns the layers.

getLearningRate

public double getLearningRate()
Returns:
Returns the learningRate.

getMaxEpochs

public long getMaxEpochs()
Returns:
Returns the maxEpochs.

getNeuralNetworkName

public java.lang.String getNeuralNetworkName()
Description copied from class: NeuralNetwork
Returns a human readable

Specified by:
getNeuralNetworkName in class NeuralNetwork
Returns:
The name
See Also:
NeuralNetwork.getNeuralNetworkName()

getPredictionError

public double getPredictionError()
Returns:
Returns the predictionError.

init

protected void init()
See Also:
yawn.nn.NeuralNetwork#init()

getInputSize

public int getInputSize()
Specified by:
getInputSize in class NeuralNetwork
See Also:
NeuralNetwork.getInputSize()

layersCount

public int layersCount()
Returns:
the number of layers in the network

layersIterator

public java.util.Iterator layersIterator()
Returns:
a java.util.Iterator of the layers list
See Also:
List.iterator()

layersListIterator

public java.util.ListIterator layersListIterator()
Returns:
The ListIterator of the layers list.
See Also:
List.listIterator()

oneLearningStep

public void oneLearningStep(Pattern input,
                            Pattern output)
Implements a learning iteration as:

Specified by:
oneLearningStep in class NeuralNetwork
Parameters:
input - The input presented to the network.
output - The expected output.
See Also:
NeuralNetwork.oneLearningStep(yawn.util.Pattern, yawn.util.Pattern)

getOutputSize

public int getOutputSize()
Specified by:
getOutputSize in class NeuralNetwork
See Also:
NeuralNetwork.getOutputSize()

predict

public Pattern predict(Pattern input)
Description copied from class: NeuralNetwork
Computes a network prediction

Specified by:
predict in class NeuralNetwork
Parameters:
input - The input to propagate.
Returns:
the network output.
See Also:
NeuralNetwork.predict(yawn.util.Pattern)

removeLayer

public void removeLayer(int index)
Parameters:
index -

setLayers

public void setLayers(java.util.List layers)
Parameters:
layers - The layers to set.

setLearningRate

public void setLearningRate(double learningRate)
Parameters:
learningRate - The learningRate to set.

setMaxEpochs

public void setMaxEpochs(long maxEpochs)
Parameters:
maxEpochs - The maxEpochs to set.

setPredictionError

public void setPredictionError(double predictionError)
Parameters:
predictionError - The predictionError to set.

train

public void train(InputOutputPattern[] iop)
Description copied from class: NeuralNetwork
Trains the network until the stop criteria is met.

Specified by:
train in class NeuralNetwork
Parameters:
iop - The training set to be learned.
See Also:
NeuralNetwork.train(yawn.util.InputOutputPattern[])

setup

public void setup(NeuralNetworkConfig config)
           throws ConfigurationException
Specified by:
setup in class NeuralNetwork
Throws:
ConfigurationException
See Also:
NeuralNetwork.setup(NeuralNetworkConfig)

yieldConfiguration

public NeuralNetworkConfig yieldConfiguration()
Specified by:
yieldConfiguration in class NeuralNetwork
See Also:
NeuralNetwork.yieldConfiguration()

getMomentumRate

public double getMomentumRate()
Returns:
Returns the momentumRate.

setMomentumRate

public void setMomentumRate(double momentumRate)
Parameters:
momentumRate - The momentumRate to set.

copy

public MultiLayerPerceptron copy()


Copyright © 2003-2005 GIAA, Universidad Carlos III de Madrid. All Rights Reserved.