Package ca.nengo.math.impl

Examples of ca.nengo.math.impl.IdentityFunction


//    assertTrue(error2 > 1e-10 && error2 < 3.5e-4 && error2 < error);
//  }

  public void testAddBias2D() throws StructuralException, SimulationException {
    Network network = new NetworkImpl();
    FunctionInput input = new FunctionInput("input", new Function[]{new IdentityFunction(1, 0)}, Units.UNK);
    network.addNode(input);
    NEFEnsembleFactory ef = new NEFEnsembleFactoryImpl();
    int n = 300;
    NEFEnsemble pre = ef.make("pre", n, 2);
    pre.addDecodedTermination("input", MU.uniform(2, 1, 1), .005f, false);
View Full Code Here


  /*
   * Test method for 'ca.nengo.math.impl.IdentityFunction.getDimension()'
   */
  public void testGetDimension() {
    IdentityFunction f = new IdentityFunction(3, 0);
    assertEquals(3, f.getDimension());
  }
View Full Code Here

  /*
   * Test method for 'ca.nengo.math.impl.IdentityFunction.map(float[])'
   */
  public void testMap() {
    IdentityFunction f = new IdentityFunction(3, 0);
    TestUtil.assertClose(.1f, f.map(new float[]{.1f, .2f, .3f}), .00001f);

    f = new IdentityFunction(3, 1);
    TestUtil.assertClose(.2f, f.map(new float[]{.1f, .2f, .3f}), .00001f);
  }
View Full Code Here

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

    float[] values = f.multiMap(new float[][]{new float[]{.1f, .2f, .3f}, new float[]{.2f, .3f, .4f}});
    TestUtil.assertClose(.1f, values[0], .00001f);
    TestUtil.assertClose(.2f, values[1], .00001f);
  }
View Full Code Here

   
    func = new FourierFunction(new float[]{1, 0.5f, 1}, new float[]{1, 1, 0.5f}, new float[]{0, -0.5f, 0.2f});
    root = nrf.findRoot(func, -5, 5, 0.0001f);
    TestUtil.assertClose(func.map(new float[]{root}), 0, 0.001f);
   
    func = new IdentityFunction(1, 0);
    root = nrf.findRoot(func, -5, 5, 0.0001f);
    TestUtil.assertClose(func.map(new float[]{root}), 0, 0.001f);
   
    func = new PiecewiseConstantFunction(new float[]{-1,1}, new float[]{2,0,-2});
    try {
View Full Code Here

  }

  private NEFEnsemble createInterneurons(String name, int num, boolean excitatoryProjection) throws StructuralException {
    final Function f;
    if (excitatoryProjection) {
      f = new IdentityFunction(1, 0);
    } else {
      f = new AbstractFunction(1) {
        private static final long serialVersionUID = 1L;
        public float map(float[] from) {
          return 1 + from[0];
View Full Code Here

   * @throws StructuralException
   */
  protected void addDefaultOrigins(NEFEnsemble ensemble) throws StructuralException {
    Function[] functions = new Function[ensemble.getDimension()];
    for (int i = 0; i < functions.length; i++) {
      functions[i] = new IdentityFunction(ensemble.getDimension(), i);
    }

    ensemble.addDecodedOrigin(NEFEnsemble.X, functions, Neuron.AXON);
  }
View Full Code Here

TOP

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

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.