Package ca.nengo.math.impl

Examples of ca.nengo.math.impl.WeightedCostApproximator


  /*
   * Test method for 'ca.nengo.math.impl.WeightedCostApproximator.pseudoInverse()'
   */
  public void testPseudoInverse() {
    WeightedCostApproximator a = new WeightedCostApproximator(new float[][]{new float[]{0f},new float[]{1f},new float[]{2f}},
        new float[][]{new float[]{3f,2f,3f},new float[]{1f,2f,3f}},
        new ConstantFunction(1,1f), 0.02f, -1);
    double[][] ps = a.pseudoInverse(new double[][]{new double[]{1,2},new double[]{3,4}}, 0f, -1);
    Matrix psM = new Matrix(ps);
    Matrix aM = new Matrix(new double[][]{new double[]{1,2},new double[]{3,4}});
    Matrix apsaM = aM.times(psM.times(aM));
   
    TestUtil.assertClose((float)apsaM.get(0,0), (float)aM.get(0,0), 0.0001f );
View Full Code Here


      }
    }
    float[][][] evalsigs = new float[1][1][];
    evalsigs[0][0] = times;
    factory = new WeightedCostApproximator.Factory(0f);
    WeightedCostApproximator approximator2 = (WeightedCostApproximator)factory.getApproximator(evalsigs, valuesig);
    coefficients = approximator2.findCoefficients(MU.transpose(targetsig.getValues())[0]);
   
    float[] approxsig = new float[times.length];
    for (int j = 0; j < times.length; j++) {
      approxsig[j] = 0f;
      for (int i = 0; i < frequencies.length; i++) {
View Full Code Here

TOP

Related Classes of ca.nengo.math.impl.WeightedCostApproximator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.