Package ca.nengo.model.impl

Examples of ca.nengo.model.impl.FunctionInput


    Network network = new NetworkImpl();

    Function f = new ConstantFunction(1, 1f);
    // Function f = new SineFunction();
    FunctionInput input = new FunctionInput("input", new Function[] { f }, Units.UNK);
    network.addNode(input);

    NEFEnsembleFactory ef = new NEFEnsembleFactoryImpl();

    NEFEnsemble integrator = ef.make("integrator", 500, 1, "integrator1", false);
    network.addNode(integrator);
    integrator.collectSpikes(true);

    // Plotter.plot(integrator);
    // Plotter.plot(integrator, NEFEnsemble.X);

    float tau = .05f;

    Termination interm = integrator.addDecodedTermination("input",
        new float[][] { new float[] { tau } }, tau, false);
    // Termination interm = integrator.addDecodedTermination("input", new
    // float[][]{new float[]{1f}}, tau);
    network.addProjection(input.getOrigin(FunctionInput.ORIGIN_NAME), interm);

    Termination fbterm = integrator.addDecodedTermination("feedback",
        new float[][] { new float[] { 1f } }, tau, false);
    network.addProjection(integrator.getOrigin(NEFEnsemble.X), fbterm);
View Full Code Here


    for (int i = 0; i < evalPoints.length; i++) {
      Function[] f = new Function[evalPoints[i].length];
      for (int j = 0; j < f.length; j++) {
        f[j] = new ConstantFunction(1, evalPoints[i][j]);
      }
      FunctionInput fi = new FunctionInput("DECODING SIMULATION INPUT", f, Units.UNK);
      environment.addNode(fi);
      environment.addProjection(fi.getOrigin(FunctionInput.ORIGIN_NAME), termination);
      probe.reset();
      environment.run(0, transientTime);
      TimeSeries result = probe.getData();
      environment.removeProjection(termination);
      environment.removeNode(fi.getName());

      values[i] = new float[result.getDimension()];
      int samples = (int) Math.ceil( result.getValues().length / 10d ); //use only last ~10% of run in the average to avoid transient
      for (int j = 0; j < result.getDimension(); j++) {
        values[i][j] = 0;
View Full Code Here

TOP

Related Classes of ca.nengo.model.impl.FunctionInput

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.