All Packages Class Hierarchy This Package Previous Next Index
Class sim.funApp.LookupTable
java.lang.Object
|
+----sim.funApp.FunApp
|
+----sim.funApp.LookupTable
- public class LookupTable
- extends FunApp
A standard lookup table of n elements (weights).
IMPORTANT NOTES AND REMINDERS:
1) dEdOut must be a single element MatrixD object.
2) There should not be a "bias". This is not a neural network.
3) There should be a 3 tuple passed as a parameter to this object for each dimension
of the lookup table. The first element is the minimum value, followed by the
maximum value, and finally the discretization factor (the number of elements in that
dimension).
4) It is not necessary for the inputs to be rounded to discrete values before being passed
to this object. The object will discretize the inputs automatically. The input vector
is treated as being a vector of indices to the lookup table. Any index that is below or
above the minimum or maximum index for that dimension will be clipped.
5) The formula for calculating an index for a given input variable a is:
floor[(n(a-min))/(max-min)] where n is the number of elements for this dimension.
6) Hessian calculations are not yet implemented.
This code is (c) 1997 Mance Harmon
<harmonme@aa.wpafb.af.mil>,
http://www.aa.wpafb.af.mil/~harmonme
The source and object code may be redistributed freely.
If the code is modified, please state so in the comments.
- Version:
- 2.0, 8 May 97
- Author:
- Mance Harmon, Leemon Baird
-
LookupTable()
-
-
BNF(int)
-
-
clone()
- Make an exact duplicate of this class.
-
cloneVars(FunApp)
- After making a copy of self during a clone(), call cloneVars() to
copy variables into the copy, then return super.cloneVars(copy).
-
evaluate()
- calculate the output for the given input
-
findGradients()
- Calculate the output and gradient for a given input.
-
findHessian()
- Calculate the output, gradient, and Hessian for a given input.
-
nWeights(int, int)
- Return # elements (weights) in the lookup table.
-
parse(Parser, int)
- Parse the input file to get the parameters for this object.
-
setIO(MatrixD, MatrixD, MatrixD, MatrixD, MatrixD, MatrixD, MatrixD, MatrixD, MatrixD)
- Define the MatrixD objects that will be used by evaluate()
and findGradients().
-
unparse(Unparser, int)
- Output a description of this object that can be parsed with parse().
LookupTable
public LookupTable()
setIO
public void setIO(MatrixD inVect,
MatrixD outVect,
MatrixD weights,
MatrixD dEdIn,
MatrixD dEdOut,
MatrixD dEdWeights,
MatrixD dEdIndIn,
MatrixD dEdOutdOut,
MatrixD dEdWeightsdWeights) throws MatrixException
- Define the MatrixD objects that will be used by evaluate()
and findGradients(). All 6 should be column vectors (n by 1 matrices).
All the MatrixD objects are copied, but the pointers still point
to the same data arrays.
- Throws: MatrixException
- if vector shapes don't match
- Overrides:
- setIO in class FunApp
evaluate
public void evaluate()
- calculate the output for the given input
- Overrides:
- evaluate in class FunApp
findGradients
public void findGradients()
- Calculate the output and gradient for a given input.
This does everything evaluate() does, plus it calculates
the gradient of the error with respect to the inputs and
weights, dEdx and dEdw,
User must set dEdOut before calling.
- Overrides:
- findGradients in class FunApp
findHessian
public void findHessian()
- Calculate the output, gradient, and Hessian for a given input.
This does everything evaluate() and findGradients() do, plus
it calculates the Hessian of the error with resepect to the
the weights and inputs, dEdxdx, dEdwdx, and dEdwdw.
- Overrides:
- findHessian in class FunApp
nWeights
public int nWeights(int nIn,
int nOut)
- Return # elements (weights) in the lookup table.
- Overrides:
- nWeights in class FunApp
BNF
public String BNF(int lang)
- Overrides:
- BNF in class FunApp
unparse
public void unparse(Unparser u,
int lang)
- Output a description of this object that can be parsed with parse().
- Overrides:
- unparse in class FunApp
- See Also:
- Parsable
parse
public Object parse(Parser p,
int lang) throws ParserException
- Parse the input file to get the parameters for this object.
- Throws: ParserException
- parser didn't find the required token
- Overrides:
- parse in class FunApp
clone
public Object clone()
- Make an exact duplicate of this class. For objects it contains, it
only duplicates the pointers, not the objects they point to. For a
new FunApp called MyFunApp, the code in this method should be the
single line: return cloneVars(new MyFunApp());
- Overrides:
- clone in class FunApp
cloneVars
public Object cloneVars(FunApp copy)
- After making a copy of self during a clone(), call cloneVars() to
copy variables into the copy, then return super.cloneVars(copy).
The variables copied are just those set in parse() and
setWatchManager(). The caller will be required to call
setIO to set up the rest of the variables.
- Overrides:
- cloneVars in class FunApp
All Packages Class Hierarchy This Package Previous Next Index