|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectca.nengo.math.impl.WeightedCostApproximator
public class WeightedCostApproximator
A LinearApproximator in which error is evaluated at a fixed set of points, and the cost function that is minimized is a weighted integral of squared error.
Uses the Moore-Penrose pseudoinverse.
TODO: test
Nested Class Summary | |
---|---|
static class |
WeightedCostApproximator.Factory
An ApproximatorFactory that produces WeightedCostApproximators. |
Constructor Summary | |
---|---|
WeightedCostApproximator(float[][] evaluationPoints,
float[][] values,
Function costFunction,
float noise,
int nSV)
|
|
WeightedCostApproximator(float[][] evaluationPoints,
float[][] values,
Function costFunction,
float noise,
int nSV,
boolean quiet)
|
Method Summary | |
---|---|
LinearApproximator |
clone()
|
float[] |
findCoefficients(Function target)
This implementation is adapted from Eliasmith & Anderson, 2003, appendix A. |
float[][] |
getEvalPoints()
|
float[][] |
getValues()
|
double[][] |
pseudoInverse(double[][] matrix,
float minSV,
int nSV)
Override this method to use a different pseudoinverse implementation (eg clustered). |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WeightedCostApproximator(float[][] evaluationPoints, float[][] values, Function costFunction, float noise, int nSV, boolean quiet)
evaluationPoints
- Points at which error is evaluated (should be uniformly
distributed, as the sum of error at these points is treated as an integral
over the domain of interest). Examples include vector inputs to an ensemble,
or different points in time within different simulation regimes.values
- The values of whatever functions are being combined, at the
evaluationPoints. Commonly neuron firing rates. The first dimension makes up
the list of functions, and the second the values of these functions at each
evaluation point.costFunction
- A cost function that weights squared error over the domain of
evaluation pointsnoise
- Standard deviation of Gaussian noise to add to values (to reduce
sensitivity to simulation noise) as a proportion of the maximum absolute
value over all valuespublic WeightedCostApproximator(float[][] evaluationPoints, float[][] values, Function costFunction, float noise, int nSV)
Method Detail |
---|
public float[][] getEvalPoints()
getEvalPoints
in interface LinearApproximator
LinearApproximator.getEvalPoints()
public float[][] getValues()
getValues
in interface LinearApproximator
LinearApproximator.getValues()
public double[][] pseudoInverse(double[][] matrix, float minSV, int nSV)
matrix
- Any matrixminSV
- Hint as to smallest singular value to usenSV
- Max number of singular values to use
public float[] findCoefficients(Function target)
This implementation is adapted from Eliasmith & Anderson, 2003, appendix A.
It solves PHI = GAMMA" UPSILON, where " denotes pseudoinverse, UPSILON_i = < cost(x) x a_i(x) >, and GAMMA_ij = < cost(x) a_i(x) a_j(x) >. <> denotes integration (the sum over eval points).
findCoefficients
in interface LinearApproximator
target
- Function to approximate
LinearApproximator.findCoefficients(ca.nengo.math.Function)
public LinearApproximator clone() throws java.lang.CloneNotSupportedException
clone
in interface LinearApproximator
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |