lnsc.pmvf
Interface FunctionalUnit2

All Superinterfaces:
java.lang.Cloneable, FunctionalUnit, java.io.Serializable
All Known Implementing Classes:
AbstractFunctionalUnit2

public interface FunctionalUnit2
extends FunctionalUnit, java.lang.Cloneable, java.io.Serializable

Interface supported by every objects that can be used like a function. Every units in a neural network, and neural networks themselves are of this type. A functional unit has the only constraint of being a multivariate real-vector-valued function.

The FunctionalUnit2 interface has methods that provide information about the type of function encapsulated by the object such as number of inputs and outputs and whether it is differentiable or not. It also provides methods to read the values and derivatives of the function for a given single input pattern or a whole batch of patterns, in which case some extra information can also be recorded.

For a complete list of FunctionalUnit included in this package see FunctionalUnit Chart

Since:
1.0

Nested Class Summary
static class FunctionalUnit2.ProcessPatternResult2
          Return type for the method processPattern(double[], boolean, boolean, boolean, boolean, java.lang.String[]).
 
Nested classes inherited from class lnsc.FunctionalUnit
FunctionalUnit.ProcessPatternResult
 
Field Summary
 
Fields inherited from interface lnsc.FunctionalUnit
EMPTY_PATTERN
 
Method Summary
 int getParameterCount()
          Indicates the number of parameters of the function.
 double[] getParameters()
          Gets a copy of the parameters as a vector.
 boolean isParameterDifferentiable()
          Indicates whether or not the function is differentiable with respect to its parameters.
 boolean isParameterTwiceDifferentiable()
          Indicates whether or not the function is twice differentiable with respect to its parameters.
 FunctionalUnit2.ProcessPatternResult2 processPattern(double[] inputPattern, boolean computeDerivative, boolean computeSecondDerivative, boolean computeParameterDerivative, boolean computeParameterSeconDerivative, java.lang.String[] recordList)
          Processes an input pattern and returns its output pattern and derivatives (if requested).
 void setParameters(double[] parameters)
          Sets the parameters values to those of a given vector.
 
Methods inherited from interface lnsc.FunctionalUnit
clone, getInputCount, getOutputCount, isDifferentiable, isStateless, isTwiceDifferentiable, processDataSet, processPattern, reset
 

Method Detail

getParameterCount

public int getParameterCount()
Indicates the number of parameters of the function.

Returns:
Number of parameters.

getParameters

public double[] getParameters()
Gets a copy of the parameters as a vector.

Returns:
A copy of the parameter values.

isParameterDifferentiable

public boolean isParameterDifferentiable()
Indicates whether or not the function is differentiable with respect to its parameters.

Returns:
true if it differentiable, false otherwise.

isParameterTwiceDifferentiable

public boolean isParameterTwiceDifferentiable()
Indicates whether or not the function is twice differentiable with respect to its parameters.

Returns:
true if it twice differentiable, false otherwise.

processPattern

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

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.
computeParameterSeconDerivative - 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).

setParameters

public void setParameters(double[] parameters)
Sets the parameters values to those of a given vector.