Package ca.nengo.math.impl

Examples of ca.nengo.math.impl.SigmoidFunction$SigmoidDerivative


  /*
   * Test method for 'ca.nengo.math.impl.NumericallyDifferentiableFunction.map(float[])'
   */
  public void testMap() {
    SigmoidFunction f = new SigmoidFunction();
    NumericallyDifferentiableFunction wrap = new NumericallyDifferentiableFunction(f, 0, 0.1f);
   
    assertEquals(wrap.map(new float[]{0}), f.map(new float[]{0}));
    assertEquals(wrap.map(new float[]{3}), f.map(new float[]{3}));
    assertEquals(wrap.map(new float[]{100}), f.map(new float[]{100}));
  }
View Full Code Here


  /*
   * Test method for 'ca.nengo.math.impl.NumericallyDifferentiableFunction.multiMap(float[][])'
   */
  public void testMultiMap() {
    SigmoidFunction f = new SigmoidFunction();
    NumericallyDifferentiableFunction wrap = new NumericallyDifferentiableFunction(f, 0, 0.1f);

    float[] values = f.multiMap(new float[][]{new float[]{3}, new float[]{-2}});
    float[] newVals = wrap.multiMap(new float[][]{new float[]{3}, new float[]{-2}});
    assertEquals(values[0],newVals[0]);
    assertEquals(values[1],newVals[1]);
  }
View Full Code Here

 
  /*
   *   Test method for 'ca.nengo.math.impl.NumericallyDifferentiableFunction.getDerivative()'
   */
  public void testGetDerivative() {
    SigmoidFunction f = new SigmoidFunction(-1f,0.5f,1f,2f);
    Function g = f.getDerivative();
    NumericallyDifferentiableFunction wrap = new NumericallyDifferentiableFunction(f, 0, 0.01f);
    Function gWrap = wrap.getDerivative();
   
    assertEquals(gWrap.getDimension(), g.getDimension());
    TestUtil.assertClose(gWrap.map(new float[]{0f}), g.map(new float[]{0f}), .0001f);
View Full Code Here

      //here is a plot of the probed vector X the gaussian basis (value at time 4.5s) ...      
      gaussianBasis.setCoefficients(p.getData().getValues()[4500]);
      //Plotter.plot(gaussianBasis, -3, .001f, 3, "gaussian basis plot");
     
     
      Function s1 = new SigmoidFunction(0, 1, 0, 1);
      Function s2 = new SigmoidFunction(0.5f, -1, 0, 1);
      FunctionBasis sigmoidBasis = new FunctionBasisImpl(new Function[]{s1, s2});
     
      //here is a plot of the probed vector X the sigmoid basis (value at time 0.5s) ...            
      sigmoidBasis.setCoefficients(p.getData().getValues()[500]);
      //Plotter.plot(sigmoidBasis, -3, .001f, 3, "sigmoid basis plot");
View Full Code Here

   
    func = new Polynomial(new float[]{4f, 2f, -3f, 1f});
    root = nrf.findRoot(func, -5, 15, 0.0001f);
    TestUtil.assertClose(func.map(new float[]{root}), 0, 0.001f);
   
    func = new SigmoidFunction(-1f, 0.3f, -0.5f, 1f);
    root = nrf.findRoot(func, -5, 5, 0.0001f);
    TestUtil.assertClose(func.map(new float[]{root}), 0, 0.001f);
   
    func = new SineFunction(0.5f);
    root = nrf.findRoot(func, -5, 5, 0.0001f);
View Full Code Here

  /**
   * Uses a default sigmoid rate function
   */
  public PoissonSpikeGenerator() {
    this(new SigmoidFunction(.5f, 10f, 0f, 20f));
  }
View Full Code Here

    /**
     * @see ca.nengo.model.neuron.impl.SpikeGeneratorFactory#make()
     */
    public SpikeGenerator make() {
      Function sigmoid = new SigmoidFunction(myInflection.sample()[0], mySlope.sample()[0], 0, myMaxRate.sample()[0]);
      return new PoissonSpikeGenerator(sigmoid);
    }
View Full Code Here

TOP

Related Classes of ca.nengo.math.impl.SigmoidFunction$SigmoidDerivative

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.