Package ca.nengo.math.impl

Examples of ca.nengo.math.impl.IndicatorPDF.sample()


   */
  public void testSample() {
    PDF pdf = new IndicatorPDF(-1, 1);
   
    for (int i = 0; i < 10; i++) {
      float[] s = pdf.sample();
      assertEquals(1, s.length);
      assertTrue(s[0] > -1 && s[0] < 1);
    }
   
    pdf = new IndicatorPDF(0, 0);
View Full Code Here


      assertEquals(1, s.length);
      assertTrue(s[0] > -1 && s[0] < 1);
    }
   
    pdf = new IndicatorPDF(0, 0);
    assertEquals(0f, pdf.sample()[0]);
  }

  /*
   * Test method for 'ca.nengo.math.impl.IndicatorPDF.getDimension()'
   */
 
View Full Code Here

        if (initialTheta == null) {
            IndicatorPDF uniform = new IndicatorPDF(0.00005f, 0.00015f);
            myInitialTheta = new float[nodeTerminations.length];
            for (int i = 0; i < myInitialTheta.length; i ++) {
                // Reasonable assumption: high gain, high theta
                myInitialTheta[i] = uniform.sample()[0] * myGain[i];
            }
        } else {
            myInitialTheta = initialTheta;
        }
        myTheta = myInitialTheta.clone();
View Full Code Here

        if (initialTheta == null) {
          IndicatorPDF uniform = new IndicatorPDF(0.00001f, 0.00002f);
          myInitialTheta = new float[nodeTerminations.length];
          for (int i = 0; i < myInitialTheta.length; i ++) {
              // Reasonable assumption: high gain, high theta
            myInitialTheta[i] = uniform.sample()[0] * myGain[i];
          }
        } else {
          myInitialTheta = initialTheta;
        }
        myTheta = myInitialTheta.clone();
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.