lnsc.lstm
Class FastLSTMNetwork

java.lang.Object
  |
  +--lnsc.pmvf.AbstractFunctionalUnit2
        |
        +--lnsc.lstm.FastLSTMNetwork
All Implemented Interfaces:
java.lang.Cloneable, FunctionalUnit, FunctionalUnit2, java.io.Serializable
Direct Known Subclasses:
ETLSTMNetwork1

public class FastLSTMNetwork
extends AbstractFunctionalUnit2

Long Short-Term Memory (LSMT) network.

Implements Gers, Schraudolph & Schmiduber 2002 (from Journal of Machine Learning Research 3:115-143) LSTM network. See also Gers, Schmidhuber, & Cummins 2000 (from Neural Computation, 12(10) 2451-2471) and Hochreiter & Schmidhuber 1997 (from Neural Computation 9(8):1735-1780).

This network memory reads the inputs, pass them through a layer of memory blocks, and weights memory blocks output before applying a layer of output units (usually sigmoidal). Eventually it may support hidden units (trainable using truncated gradient). The memory blocks are fully recurrently connected. The input are expendend with a bias unit to feed the memory block. The parameters are all the weights feeding the memory block (foward and recurrent) and the weights feeding the output layer. Output layer can be feed by everything (bias, input, memory block outputs, memory block gates). Gradient from network output to all the weights is provided as in the paper. Only derivatives to these parameters is available.

Parameters are all the weights of the memory blocks and all the weights of the output layer. Derivative to parameters represent the derivative of each output z_k(t) with respect to each weights based on the papers formulas.

Memory cells internal states, outputs, and memory block gates are available through keywords in LSTMDataNames.

Cloning is done through serialization, transient states are therefore transient to cloning too (e.g. reseted in clones).

Avoid using this class directly or deriving it unless you really know what you do. Use Factories instead as much as possible.

Since:
1.0
See Also:
FastLSTMMemoryBlock, AbstractLSTMFactory, LSTMFactory, LSTMDataNames, Serialized Form

Nested Class Summary
 
Nested classes inherited from class lnsc.pmvf.FunctionalUnit2
FunctionalUnit2.ProcessPatternResult2
 
Nested classes inherited from class lnsc.FunctionalUnit
FunctionalUnit.ProcessPatternResult
 
Field Summary
 boolean m_Debug
          Public debug info output.
 
Fields inherited from interface lnsc.FunctionalUnit
EMPTY_PATTERN
 
Method Summary
 java.lang.Object clone()
           
 double[] getParameters()
          Gets a copy of the parameters as a vector.
 FunctionalUnit2.ProcessPatternResult2 processPattern(double[] inputPattern, boolean computeDerivative, boolean computeSecondDerivative, boolean computeParameterDerivative, boolean computeParameterSecondDerivative, java.lang.String[] recordList)
          Processes an input pattern and returns its output pattern and derivatives (if requested).
 void reset()
          Reset internal transient state for non stateless functions.
 void setParameters(double[] parameters)
          Sets the parameters values to those of a given vector.
 java.lang.String toString()
           
 
Methods inherited from class lnsc.pmvf.AbstractFunctionalUnit2
getInputCount, getOutputCount, getParameterCount, isDifferentiable, isParameterDifferentiable, isParameterTwiceDifferentiable, isStateless, isTwiceDifferentiable, processDataSet, processPattern
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_Debug

public boolean m_Debug
Public debug info output.

Method Detail

clone

public java.lang.Object clone()
Specified by:
clone in interface FunctionalUnit
Overrides:
clone in class AbstractFunctionalUnit2

getParameters

public double[] getParameters()
Description copied from interface: FunctionalUnit2
Gets a copy of the parameters as a vector.

Returns:
A copy of the parameter values.

processPattern

public FunctionalUnit2.ProcessPatternResult2 processPattern(double[] inputPattern,
                                                            boolean computeDerivative,
                                                            boolean computeSecondDerivative,
                                                            boolean computeParameterDerivative,
                                                            boolean computeParameterSecondDerivative,
                                                            java.lang.String[] recordList)
Description copied from interface: FunctionalUnit2
Processes an input pattern and returns its output pattern and derivatives (if requested).

Specified by:
processPattern in interface FunctionalUnit2
Overrides:
processPattern in class AbstractFunctionalUnit2
Parameters:
inputPattern - The input pattern.
computeDerivative - Must be true if the derivative should be computed.
computeSecondDerivative - Must be true if the second derivative should be computed.
computeParameterDerivative - Must be true if the derivative with respect to the parameters should be computed.
computeParameterSecondDerivative - Must be true if be the derivative with respect to the parameters should be computed.
recordList - Extra data to be recorded.
Returns:
The output pattern and the derivative (if requested).

reset

public void reset()
Description copied from interface: FunctionalUnit
Reset internal transient state for non stateless functions.

Specified by:
reset in interface FunctionalUnit
Overrides:
reset in class AbstractFunctionalUnit2

setParameters

public void setParameters(double[] parameters)
Description copied from interface: FunctionalUnit2
Sets the parameters values to those of a given vector.


toString

public java.lang.String toString()
Overrides:
toString in class AbstractFunctionalUnit2