Package ca.nengo.math.impl

Examples of ca.nengo.math.impl.PiecewiseConstantFunction


    Termination t = integrator.addTermination("input", new float[]{1}, .005f, false);
    ALIFSpikeGenerator generator = new ALIFSpikeGenerator(.0005f, .02f, .2f, .05f);
    SpikingNeuron neuron = new SpikingNeuron(integrator, generator, 2, 5, "neuron");
    network.addNode(neuron);

    Function f = new PiecewiseConstantFunction(new float[]{1, 2}, new float[]{0, 1, -1});
//    Function f = new SineFunction((float) Math.PI, 1f / (float) Math.PI);
//    Plotter.plot(f, 0, .01f, 3, "input");
    FunctionInput input = new FunctionInput("input", new Function[]{f}, Units.UNK);
    network.addNode(input);
View Full Code Here


            EnsembleImpl ensemble = new EnsembleImpl("ensemble", neurons);
            ensemble.addTermination("input", weights, .005f, false);
            ensemble.collectSpikes(true);
            network.addNode(ensemble);

            FunctionInput input = new FunctionInput("input", new Function[]{new PiecewiseConstantFunction(new float[]{0.2f}, new float[]{0, 0.5f})}, Units.UNK);
            network.addNode(input);

            network.addProjection(input.getOrigin(FunctionInput.ORIGIN_NAME), ensemble.getTermination("input"));

//          Probe vProbe = network.getSimulator().addProbe("ensemble", 0, "V", true);
View Full Code Here

   
    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 {
      root = nrf.findRoot(func, -5, 15, 0.0001f);
    } catch (RuntimeException e) { // failure after too many attempts
    }
   
View Full Code Here

TOP

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

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.