public class GradientDescentApproximator extends java.lang.Object implements LinearApproximator
Modifier and Type | Class and Description |
---|---|
static class |
GradientDescentApproximator.CoefficientsSameSign
Forces all decoding coefficients to be >= 0.
|
static interface |
GradientDescentApproximator.Constraints
Enforces constraints on coefficients.
|
static class |
GradientDescentApproximator.Factory
An ApproximatorFactory that produces GradientDescentApproximators.
|
Constructor and Description |
---|
GradientDescentApproximator(float[][] evaluationPoints,
float[][] values,
GradientDescentApproximator.Constraints constraints,
boolean ignoreBias) |
Modifier and Type | Method and Description |
---|---|
LinearApproximator |
clone() |
float[] |
findCoefficients(Function target)
Note: more information is needed than the arguments provide (for example
the functions that are to be combined to estimate the target).
|
float[][] |
getEvalPoints() |
int |
getMaxIterations() |
float |
getTolerance() |
float[][] |
getValues() |
void |
setMaxIterations(int max) |
void |
setStartingCoefficients(float[] coefficients) |
void |
setTolerance(float tolerance) |
public GradientDescentApproximator(float[][] evaluationPoints, float[][] values, GradientDescentApproximator.Constraints constraints, boolean ignoreBias)
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.constraints
- Constraints on coefficientsignoreBias
- If true, bias in constituent and target functions is ignored (resulting
estimate will be biased)public float[][] getEvalPoints()
getEvalPoints
in interface LinearApproximator
LinearApproximator.getEvalPoints()
public float[][] getValues()
getValues
in interface LinearApproximator
LinearApproximator.getValues()
public void setStartingCoefficients(float[] coefficients)
coefficients
- Coefficients at which to start the optimizationpublic int getMaxIterations()
public void setMaxIterations(int max)
max
- New maximum number of iterations per findCoefficients(...)public float getTolerance()
public void setTolerance(float tolerance)
tolerance
- Target mean-squared errorpublic float[] findCoefficients(Function target)
LinearApproximator
findCoefficients
in interface LinearApproximator
target
- Function to approximateLinearApproximator.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
- if clone can't be made