Nengo.ca

ca.nengo.math.impl
Class WeightedCostApproximator.Factory

java.lang.Object
  extended by 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.

See Also:
Serialized Form

Constructor Summary
WeightedCostApproximator.Factory(float noise)
           
WeightedCostApproximator.Factory(float noise, boolean quiet)
           
WeightedCostApproximator.Factory(float noise, int NSV)
           
WeightedCostApproximator.Factory(float noise, int NSV, boolean quiet)
           
 
Method Summary
 ApproximatorFactory clone()
           
 LinearApproximator getApproximator(float[][][] evaluationSignals, float[][][] values)
          Similar to getApproximator(float[][], float[][]) but uses evaluation signals and outputs computed over time.
 LinearApproximator getApproximator(float[][] evalPoints, float[][] values)
           
 Function getCostFunction(int dimension)
          Note: override to use non-uniform error weighting.
 float getNoise()
           
 int getNSV()
           
 boolean getQuiet()
           
 void setNoise(float noise)
           
 void setNSV(int nSV)
           
 void setQuiet(boolean quiet)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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)
Parameters:
noise - Random noise to add to component functions (proportion of largest value over all functions)
quiet - Turn off logging?

WeightedCostApproximator.Factory

public WeightedCostApproximator.Factory(float noise,
                                        int NSV)
Parameters:
noise - Random noise to add to component functions (proportion of largest value over all functions)
NSV - Number of singular values to keep

WeightedCostApproximator.Factory

public WeightedCostApproximator.Factory(float noise,
                                        int NSV,
                                        boolean quiet)
Parameters:
noise - Random noise to add to component functions (proportion of largest value over all functions)
NSV - Number of singular values to keep
quiet - Turn off logging?
Method Detail

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 functions 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[][])

getApproximator

public LinearApproximator getApproximator(float[][][] evaluationSignals,
                                          float[][][] values)
Similar to getApproximator(float[][], float[][]) but uses evaluation signals and outputs computed over time.

Parameters:
evaluationSignals - Signals over which component functions are evaluated. First dimension is the signal, second is the dimension, and third is time.
values - values of component functions over the evaluation signals. First dimension is the component, second is the signal, and third is time.
Returns:
A LinearApproximator that can be used to approximate new Functions as a weighted sum of the given components.

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
Returns:
Valid clone
Throws:
java.lang.CloneNotSupportedException - if clone can't be made

Nengo.ca