org.joone.engine
Class WTALayer

java.lang.Object
  extended by org.joone.engine.Layer
      extended by org.joone.engine.SimpleLayer
          extended by org.joone.engine.WTALayer
All Implemented Interfaces:
java.io.Serializable, java.lang.Runnable, Learnable, LearnableLayer, NeuralLayer, Inspectable

public class WTALayer
extends SimpleLayer

This layer implements the Winner Takes All SOM strategy. The layer expects to receive euclidean distances between the previous synapse weights and it's input. The layer simply works out which node is the winner and passes 1.0 for that node and 0.0 for the others.

See Also:
parent, Serialized Form

Field Summary
 
Fields inherited from class org.joone.engine.Layer
bias, gradientInps, gradientOuts, inps, inputPatternListeners, learnable, learning, m_batch, monitor, myLearner, outputPatternListeners, outs, running, step, STOP_FLAG
 
Constructor Summary
WTALayer()
          The default constructor for this WTALayer.
WTALayer(java.lang.String ElemName)
          The constructor allowing a name to be specified.
 
Method Summary
 void backward(double[] pattern)
          No biases need updating or setting.
 java.util.TreeSet check()
          Check that there are no errors or problems with the properties of this WTALayer.
 void forward(double[] pattern)
          This method accepts an array of values from the input and forwards it according to the Winner Takes All strategy.
 double getDefaultState()
          Return the default state of a node in this layer, such as 0 for a tanh or 0.5 for a sigmoid layer
 double getDerivative(int i)
          Similar to the backward message and used by RTRL
 int getLayerDepth()
          Getter for property LayerDepth.
 int getLayerHeight()
          Getter for property LayerHeight.
 int getLayerWidth()
          Getter for property LayerWidth.
 double getMaximumState()
          Return maximum value of a node in this layer
 double getMinimumState()
          Return minimum value of a node in this layer
 java.util.Collection Inspections()
          It doesn't make sense to return biases for this layer
 void setLayerDepth(int layerDepth)
          Setter for property layerDepth.
 void setLayerHeight(int LayerHeight)
          Setter for property LayerHeight.
 void setLayerWidth(int LayerWidth)
          Setter for property LayerWidth.
 
Methods inherited from class org.joone.engine.SimpleLayer
getLearningRate, getLrate, getMomentum, setDimensions, setLrate, setMomentum, setMonitor
 
Methods inherited from class org.joone.engine.Layer
addInputSynapse, addNoise, addOutputSynapse, adjustSizeToFwdPattern, adjustSizeToRevPattern, checkInputEnabled, checkInputs, checkOutputs, copyInto, finalize, fireFwdGet, fireFwdPut, fireRevGet, fireRevPut, fwdRun, getAllInputs, getAllOutputs, getBias, getDimension, getLastGradientInps, getLastGradientOuts, getLastInputs, getLastOutputs, getLayerName, getLearner, getMonitor, getRows, getThreadMonitor, hasStepCounter, init, initLearner, InspectableTitle, isInputLayer, isOutputLayer, isRunning, join, randomize, randomizeBias, randomizeWeights, removeAllInputs, removeAllOutputs, removeInputSynapse, removeListener, removeOutputSynapse, resetInputListeners, revRun, run, setAllInputs, setAllOutputs, setBias, setConnDimensions, setInputDimension, setInputSynapses, setLastInputs, setLastOutputs, setLayerName, setOutputDimension, setOutputSynapses, setRows, start, stop, sumBackInput, sumInput, toString
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WTALayer

public WTALayer()
The default constructor for this WTALayer.


WTALayer

public WTALayer(java.lang.String ElemName)
The constructor allowing a name to be specified.

Parameters:
ElemName - The name of the Layer
Method Detail

backward

public void backward(double[] pattern)
              throws JooneRuntimeException

No biases need updating or setting. Not implemented / not required.

Overrides:
backward in class SimpleLayer
Parameters:
pattern - The pattern with which to update internal variables. Not required.
Throws:
JooneRuntimeException - The Joone Run time exception.

getDerivative

public double getDerivative(int i)
Similar to the backward message and used by RTRL

Specified by:
getDerivative in class Layer

forward

public void forward(double[] pattern)
             throws JooneRuntimeException
This method accepts an array of values from the input and forwards it according to the Winner Takes All strategy. See class documentation.

Specified by:
forward in class Layer
Parameters:
pattern -

Should be the euclidean distance between the previous synapse's input vector and weights.

Throws:
JooneRuntimeException - This Exception is a wrapper Exception when an Exception is thrown while doing the maths.
See Also:
(double[])

getLayerDepth

public int getLayerDepth()
Getter for property LayerDepth.

Returns:
Value of property LayerDepth.

setLayerDepth

public void setLayerDepth(int layerDepth)
Setter for property layerDepth.

Parameters:
LayerDepth - New value of property layerDepth.

getLayerHeight

public int getLayerHeight()
Getter for property LayerHeight.

Returns:
Value of property LayerHeight.

setLayerHeight

public void setLayerHeight(int LayerHeight)
Setter for property LayerHeight.

Parameters:
LayerHeight - New value of property LayerHeight.

getLayerWidth

public int getLayerWidth()
Getter for property LayerWidth.

Returns:
Value of property LayerWidth.

setLayerWidth

public void setLayerWidth(int LayerWidth)
Setter for property LayerWidth.

Parameters:
LayerWidth - New value of property LayerWidth.

check

public java.util.TreeSet check()
Check that there are no errors or problems with the properties of this WTALayer.

Specified by:
check in interface NeuralLayer
Overrides:
check in class Layer
Returns:
The TreeSet of errors / problems if any.
See Also:
NeuralLayer

Inspections

public java.util.Collection Inspections()
It doesn't make sense to return biases for this layer

Specified by:
Inspections in interface Inspectable
Overrides:
Inspections in class Layer
Returns:
null
See Also:
org.joone.Inspection

getDefaultState

public double getDefaultState()
Description copied from class: Layer
Return the default state of a node in this layer, such as 0 for a tanh or 0.5 for a sigmoid layer

Specified by:
getDefaultState in class Layer

getMinimumState

public double getMinimumState()
Description copied from class: Layer
Return minimum value of a node in this layer

Specified by:
getMinimumState in class Layer

getMaximumState

public double getMaximumState()
Description copied from class: Layer
Return maximum value of a node in this layer

Specified by:
getMaximumState in class Layer


Submit Feedback to pmarrone@users.sourceforge.net