ca.nengo.math.impl
Class WeightedCostApproximator.Factory
java.lang.Object
ca.nengo.math.impl.WeightedCostApproximator.Factory
- All Implemented Interfaces:
- ApproximatorFactory, java.io.Serializable, java.lang.Cloneable
- Enclosing class:
- WeightedCostApproximator
public static class WeightedCostApproximator.Factory
- extends java.lang.Object
- implements ApproximatorFactory
An ApproximatorFactory that produces WeightedCostApproximators.
- Author:
- Bryan Tripp
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WeightedCostApproximator.Factory
public WeightedCostApproximator.Factory(float noise)
- Parameters:
noise
- Random noise to add to component functions (proportion of largest value over all functions)
WeightedCostApproximator.Factory
public WeightedCostApproximator.Factory(float noise,
boolean quiet)
WeightedCostApproximator.Factory
public WeightedCostApproximator.Factory(float noise,
int NSV)
WeightedCostApproximator.Factory
public WeightedCostApproximator.Factory(float noise,
int NSV,
boolean quiet)
getNoise
public float getNoise()
- Returns:
- Random noise to add to component functions (proportion of largest value over all functions)
setNoise
public void setNoise(float noise)
- Parameters:
noise
- Random noise to add to component functions (proportion of largest value over all functions)
getNSV
public int getNSV()
- Returns:
- Maximum number of singular values to use in pseudoinverse of correlation matrix (zero or less means
use as many as possible to a threshold magnitude determined by noise).
setNSV
public void setNSV(int nSV)
- Parameters:
nSV
- Maximum number of singular values to use in pseudoinverse of correlation matrix (zero or less means
use as many as possible to a threshold magnitude determined by noise).
getQuiet
public boolean getQuiet()
- Returns:
- Whether or not information will be printed out to console during make process.
setQuiet
public void setQuiet(boolean quiet)
- Parameters:
quiet
- Controls whether or not information will be printed out to console during make process.
getApproximator
public LinearApproximator getApproximator(float[][] evalPoints,
float[][] values)
- Specified by:
getApproximator
in interface ApproximatorFactory
- Parameters:
evalPoints
- Points at which component functions are evaluated. These should
usually be uniformly distributed, because the sum of error at these points is
treated as an integral over the domain of interest.values
- The values of component funcitons at the evalPoints. The first dimension
makes up the list of functions, and the second the values of these functions at each
evaluation point.
- Returns:
- A LinearApproximator that can be used to approximate new Functions as a wieghted
sum of the given components.
- See Also:
ApproximatorFactory.getApproximator(float[][], float[][])
getCostFunction
public Function getCostFunction(int dimension)
- Note: override to use non-uniform error weighting.
- Parameters:
dimension
- Dimension of the function to be approximated
- Returns:
- A function over the input space that defines relative importance of error at each point (defaults
to a ConstantFunction)
clone
public ApproximatorFactory clone()
throws java.lang.CloneNotSupportedException
- Specified by:
clone
in interface ApproximatorFactory
- Overrides:
clone
in class java.lang.Object
- Throws:
java.lang.CloneNotSupportedException