|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--lnsc.pmvf.AbstractFunctionalUnit2
|
+--lnsc.pmvf.FastSingleLayerNeuralNetwork
Implements a single layer feed forward network. It computes a weighted sum of each inputs for each output units. Output units are simple units (i.e. units with a single input and output) and markovienne (i.e. their output does not depend on anything else then their input). A bias can be added internally to the weighted sum if needed. Internal bias is added by expanding the input pattern by the left with the value 1 (i.e. inputPattern = [1 | inputPattern]).
This class is not very flexible, it is limited to simple output units and
does not support embedded pre and post processing nor extra
DataNames keywords except DataNames.NET_INPUT.
processPattern is slightly faster than processDataSet and it
is slightly faster when units implement processPattern directly such
as classes derivated from AbstractSimpleUnit.
This class is planned to support left and right weight matrix multiplications or row-based or column-based concatenated weight vector for parametric methods. By default the weighted sum is given by y = Wx (left multiplication) and the parameter vector p = [w1 | ... | wk] where wi are the rows of W (rows concatenation).
| Nested Class Summary |
| Nested classes inherited from class lnsc.pmvf.FunctionalUnit2 |
FunctionalUnit2.ProcessPatternResult2 |
| Nested classes inherited from class lnsc.FunctionalUnit |
FunctionalUnit.ProcessPatternResult |
| Field Summary |
| Fields inherited from interface lnsc.FunctionalUnit |
EMPTY_PATTERN |
| Constructor Summary | |
FastSingleLayerNeuralNetwork(int newInputCount,
boolean newHasBias,
FunctionalUnit[] newOutputUnits)
Creates a single layer network for a given number of inputs, and with a given number of output units of a given type. |
|
FastSingleLayerNeuralNetwork(int newInputCount,
boolean newHasBias,
FunctionalUnit[] newOutputUnits,
boolean newUseLeftMultiplication,
boolean newUseRowsConcatenation)
Creates a single layer network for a given number of inputs, and with a given number of output units of a given type. |
|
FastSingleLayerNeuralNetwork(int newInputCount,
boolean newHasBias,
int newOutputCount,
FunctionalUnit newOutputUnit)
Creates a single layer network for a given number of inputs, and with a given number of output units of a given type. |
|
FastSingleLayerNeuralNetwork(int newInputCount,
boolean newHasBias,
int newOutputCount,
FunctionalUnit newOutputUnit,
boolean newUseLeftMultiplication,
boolean newUseRowsConcatenation)
Creates a single layer network for a given number of inputs, and with a given number of output units of a given type. |
|
| Method Summary | |
java.lang.Object |
clone()
|
FunctionalUnit[] |
getOutputUnits()
Gets a reference to the array of output units. |
double[] |
getParameters()
Gets a copy of the parameters as a vector. |
double[][] |
getWeights()
Gets a reference to the weight matrix. |
boolean |
hasBias()
Indicates whether there is an internal bias. |
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. |
void |
setWeights(double[][] newWeights)
Assigns a new weight matrix by reference. |
java.lang.String |
toString()
|
boolean |
useLeftMultiplication()
Indicates whether it used weights matrix as left multiplication (y = Wx) of the input pattern or as right multiplication (y = xW) of the inputs. |
boolean |
useRowsConcatenation()
Indicates whether the matrix is tranformed by concatenation of its rows (p = [w1 | ... |
| 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 |
| Constructor Detail |
public FastSingleLayerNeuralNetwork(int newInputCount,
boolean newHasBias,
FunctionalUnit[] newOutputUnits)
newInputCount - Number of inputs.newHasBias - Indicates whether a bias input
should be added internally.newOutputUnits - Array of simple output units.
public FastSingleLayerNeuralNetwork(int newInputCount,
boolean newHasBias,
FunctionalUnit[] newOutputUnits,
boolean newUseLeftMultiplication,
boolean newUseRowsConcatenation)
newInputCount - Number of inputs.newHasBias - Indicates whether a bias input
should be added internally.newOutputUnits - Array of simple output units.newUseLeftMultiplication - true for left
multiplication (y = Wx) and
false for right
multiplication (y = xW).newUseRowsConcatenation - true for rows
concatenation (p = [w1 | ... | wk]
where wi are rows of W) and
false for columns
concatenation (p = [w1T | ... | wkT]
where wj are columns of W).
public FastSingleLayerNeuralNetwork(int newInputCount,
boolean newHasBias,
int newOutputCount,
FunctionalUnit newOutputUnit)
newInputCount - Number of inputs.newHasBias - Indicates whether a bias input
should be added internally.newOutputCount - Number of outputs.newOutputUnit - Sample of an output unit.
public FastSingleLayerNeuralNetwork(int newInputCount,
boolean newHasBias,
int newOutputCount,
FunctionalUnit newOutputUnit,
boolean newUseLeftMultiplication,
boolean newUseRowsConcatenation)
newInputCount - Number of inputs.newHasBias - Indicates whether a bias input
should be added internally.newOutputCount - Number of outputs.newOutputUnit - Sample of an output unit.newUseLeftMultiplication - true for left
multiplication (y = Wx) and
false for right
multiplication (y = xW).newUseRowsConcatenation - true for rows
concatenation (p = [w1 | ... | wk]
where wi are rows of W) and
false for columns
concatenation (p = [w1T | ... | wkT]
where wj are columns of W).| Method Detail |
public java.lang.Object clone()
clone in interface FunctionalUnitclone in class AbstractFunctionalUnit2public final FunctionalUnit[] getOutputUnits()
public double[] getParameters()
FunctionalUnit2
public double[][] getWeights()
public boolean hasBias()
true id there is an internal bias.
public FunctionalUnit2.ProcessPatternResult2 processPattern(double[] inputPattern,
boolean computeDerivative,
boolean computeSecondDerivative,
boolean computeParameterDerivative,
boolean computeParameterSecondDerivative,
java.lang.String[] recordList)
FunctionalUnit2
processPattern in interface FunctionalUnit2processPattern in class AbstractFunctionalUnit2inputPattern - 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.
public void reset()
FunctionalUnit
reset in interface FunctionalUnitreset in class AbstractFunctionalUnit2public void setParameters(double[] parameters)
FunctionalUnit2
public void setWeights(double[][] newWeights)
public java.lang.String toString()
toString in class AbstractFunctionalUnit2public boolean useLeftMultiplication()
true if it uses left multiplication (default).public boolean useRowsConcatenation()
true if it uses rows concatenation (default).
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||