Nengo.ca

ca.nengo.math.impl
Class CompositeApproximator

java.lang.Object
  extended by ca.nengo.math.impl.CompositeApproximator
All Implemented Interfaces:
LinearApproximator, java.io.Serializable, java.lang.Cloneable

public class CompositeApproximator
extends java.lang.Object
implements LinearApproximator

A LinearApproximator that approximates multi-dimensional functions as sums of lower-dimensional functions. Each lower-dimensional function is approximated by a component approximator, which is provided in the constructor. The resulting approximation is the sum of approximations produced by each component.

CompositeApproximator is similar to the simpler IndependentDimensionApproximator, but more general because dimensions can be handled either independently or in arbitrary groups.

CompositeApproximator is useful for low-dimensionally non-linear functions of high-dimensional vectors, eg x1*x2 + x3*x4 - x5*x6.

It is also useful for creating accurate, high-dimensional ensembles of neurons with a little overlap between dimensions.

TODO: should LinearApproximator have getDimension()? would be possible to get rid of 2nd constructor arg then TODO: test

See Also:
Serialized Form

Constructor Summary
CompositeApproximator(LinearApproximator[] components, int[][] dimensions)
           
 
Method Summary
 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()
           
 float[][] getValues()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompositeApproximator

public CompositeApproximator(LinearApproximator[] components,
                             int[][] dimensions)
Parameters:
components - LinearApproximators that make up the composite
dimensions - dimensionality of each LinearApproximator
Method Detail

getEvalPoints

public float[][] getEvalPoints()
Specified by:
getEvalPoints in interface LinearApproximator
Returns:
Points at which target functions are evaluated. Each row (or float[]) corresponds to a single evaluation point. These points should usually be uniformly distributed, because the sum of error at these points is treated as an integral over the domain of interest.
See Also:
LinearApproximator.getEvalPoints()

getValues

public float[][] getValues()
Specified by:
getValues in interface LinearApproximator
Returns:
The values of component functions at the evaluation points. The first dimension makes up the list of functions, and the second the values of these functions at each evaluation point.
See Also:
LinearApproximator.getValues()

findCoefficients

public float[] findCoefficients(Function target)
Description copied from interface: LinearApproximator
Note: more information is needed than the arguments provide (for example the functions that are to be combined to estimate the target). These other data are object properties. This enables re-use of calculations based on these data, for estimating multiple functions.

Specified by:
findCoefficients in interface LinearApproximator
Parameters:
target - Function to approximate
Returns:
coefficients on component functions which result in an approximation of the target
See Also:
LinearApproximator.findCoefficients(ca.nengo.math.Function)

clone

public LinearApproximator clone()
                         throws java.lang.CloneNotSupportedException
Specified by:
clone in interface LinearApproximator
Overrides:
clone in class java.lang.Object
Returns:
Valid clone
Throws:
java.lang.CloneNotSupportedException - if clone can't be made

Nengo.ca