Examples of genVectors()


Examples of ca.nengo.math.impl.IndependentDimensionApproximator.EncoderFactory.genVectors()

    public static void main(String[] args) {
//      EvalPointFactory epf = new EvalPointFactory(1, 10);
//      float[][] foo = epf.genVectors(100, 3);
        EncoderFactory ef = new EncoderFactory(1);
        float[][] foo = ef.genVectors(10, 3);
        System.out.println(MU.toString(foo, 10));
    }
}
View Full Code Here

Examples of ca.nengo.util.VectorGenerator.genVectors()

   */
  public void testGenVectors() {
    VectorGenerator vg = null;
   
    vg = new RandomHypersphereVG(true, 1f, 1f);
    float[][] v = vg.genVectors(10, 3);
    for (int i = 0; i < v.length; i++) {
      float radius = (float) Math.pow(v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2], .5);
      TestUtil.assertClose(1f, radius, .0001f);
    }

View Full Code Here

Examples of ca.nengo.util.VectorGenerator.genVectors()

      float radius = (float) Math.pow(v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2], .5);
      TestUtil.assertClose(1f, radius, .0001f);
    }

    vg = new RandomHypersphereVG(true, 1f, 0f);
    v = vg.genVectors(10, 3);
    for (int i = 0; i < v.length; i++) {
      float radius = (float) Math.pow(v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2], .5);
      TestUtil.assertClose(1f, radius, .0001f);
    }

View Full Code Here

Examples of ca.nengo.util.VectorGenerator.genVectors()

      float radius = (float) Math.pow(v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2], .5);
      TestUtil.assertClose(1f, radius, .0001f);
    }

    vg = new RandomHypersphereVG(true, 1f, .5f);
    v = vg.genVectors(10, 3);
    for (int i = 0; i < v.length; i++) {
      float radius = (float) Math.pow(v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2], .5);
      TestUtil.assertClose(1f, radius, .0001f);
    }
   
View Full Code Here

Examples of ca.nengo.util.VectorGenerator.genVectors()

      float radius = (float) Math.pow(v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2], .5);
      TestUtil.assertClose(1f, radius, .0001f);
    }
   
    vg = new RandomHypersphereVG(false, 1f, 1f);
    v = vg.genVectors(10, 3);
    for (int i = 0; i < v.length; i++) {
      float radius = (float) Math.pow(v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2], .5);
      assertTrue(radius < 1f);
    }
   
View Full Code Here

Examples of ca.nengo.util.VectorGenerator.genVectors()

      float radius = (float) Math.pow(v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2], .5);
      assertTrue(radius < 1f);
    }
   
    vg = new RandomHypersphereVG(true, 2f, 1f);
    v = vg.genVectors(10, 3);
    for (int i = 0; i < v.length; i++) {
      float radius = (float) Math.pow(v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2], .5);
      TestUtil.assertClose(2f, radius, .0001f);
    }

View Full Code Here

Examples of ca.nengo.util.VectorGenerator.genVectors()

      float radius = (float) Math.pow(v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2], .5);
      TestUtil.assertClose(2f, radius, .0001f);
    }

    vg = new RandomHypersphereVG(true, 1f, 1f);
    v = vg.genVectors(10, 3);
    for (int i = 0; i < v.length; i++) {
      TestUtil.assertClose(1f, Math.abs(v[i][0]) + Math.abs(v[i][1]) + Math.abs(v[i][2]), .0001f);
    }
  }

View Full Code Here

Examples of ca.nengo.util.VectorGenerator.genVectors()

    if (myNode instanceof NEFEnsemble) {
      NEFEnsemble ensemble = (NEFEnsemble) myNode;

      VectorGenerator vg = new RandomHypersphereVG(false, 1, 0);
      float[][] unscaled = vg.genVectors(samples, ensemble.getDimension());
      float[][] input = new float[unscaled.length][];
      for (int i = 0; i < input.length; i++) {
        input[i] = MU.prodElementwise(unscaled[i], ensemble.getRadii());
      }
View Full Code Here

Examples of ca.nengo.util.impl.RandomHypersphereVG.genVectors()

    if (myNode instanceof NEFEnsemble) {
      NEFEnsemble ensemble = (NEFEnsemble) myNode;

      VectorGenerator vg = new RandomHypersphereVG(false, 1, 0);
      float[][] unscaled = vg.genVectors(samples, ensemble.getDimension());
      float[][] input = new float[unscaled.length][];
      for (int i = 0; i < input.length; i++) {
        input[i] = MU.prodElementwise(unscaled[i], ensemble.getRadii());
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.