Examples of run()


Examples of ca.nengo.model.Network.run()

    float[][] directWeights = MU.prod(post.getEncoders(), MU.prod(t.getTransform(), MU.transpose(o.getDecoders())));
    System.out.println("Direct weights: " + MU.min(directWeights) + " to " + MU.max(directWeights));

    Probe probe = network.getSimulator().addProbe(post.getName(), NEFEnsemble.X, true);
    network.setMode(SimulationMode.CONSTANT_RATE);
    network.run(-1.5f, 1);
    network.setMode(SimulationMode.DEFAULT);
    float[] reference = MU.transpose(DataUtils.filter(probe.getData(), .01f).getValues())[0];

    network.run(-1.5f, 1);
//    Plotter.plot(probe.getData(), "mixed weights");
View Full Code Here

Examples of ca.nengo.model.impl.FunctionInput.run()

    FunctionInput input = new FunctionInput("test", new Function[]{new ConstantFunction(1, 1f), new ConstantFunction(1, 2f)}, Units.UNK);
    Origin origin = input.getOrigin(FunctionInput.ORIGIN_NAME);
    assertEquals(2, origin.getValues().getDimension());
    assertEquals(2, ((RealOutput) origin.getValues()).getValues().length);
   
    input.run(0f, 1f);
    assertEquals(2, origin.getValues().getDimension());
    assertEquals(2, ((RealOutput) origin.getValues()).getValues().length);
    float value = ((RealOutput) origin.getValues()).getValues()[0];
    assertTrue(value > .9f);
    value = ((RealOutput) origin.getValues()).getValues()[1];
View Full Code Here

Examples of ca.nengo.model.impl.NetworkImpl.run()

    ensemble.addDecodedTermination("input", MU.I(1), .005f, false);
    ensemble.collectSpikes(true);
    network.addNode(ensemble);
   
    network.addProjection(input.getOrigin(FunctionInput.ORIGIN_NAME), ensemble.getTermination("input"));
    network.run(0, 2);
   
    SpikePattern unsorted = ensemble.getSpikePattern();
    SpikePattern sorted = DataUtils.sort(unsorted, ensemble);
   
    Plotter.plot(unsorted);
View Full Code Here

Examples of ca.nengo.model.impl.PassthroughNode.run()

  public void testRun() throws SimulationException, StructuralException {
    PassthroughNode node1 = new PassthroughNode("test", 2);
    node1.getTermination(PassthroughNode.TERMINATION).setValues(
        new SpikeOutputImpl(new boolean[]{true, false}, Units.UNK, 0));
    node1.run(0, .01f);
    SpikeOutput out1 = (SpikeOutput) node1.getOrigin(PassthroughNode.ORIGIN).getValues();
    assertEquals(true, out1.getValues()[0]);
    assertEquals(false, out1.getValues()[1]);
   
    Map<String, float[][]> terminations2 = new HashMap<String, float[][]>(10);
View Full Code Here

Examples of ca.nengo.model.nef.NEFNode.run()

      }

      for (int i = 0; i < result.length; i++) {
        node.setRadialInput(getRadialInput(evalPoints[i], nodeIndex));

        node.run(0f, 0f);

        RealOutput output = (RealOutput) node.getOrigin(origin).getValues();
        result[i] = output.getValues()[0];
      }
View Full Code Here

Examples of ca.nengo.model.nef.impl.DecodedOrigin.run()

//          ((NEFNode) nodes[j]).setRadialInput(x[i]*encoders[j][0]);
          ((NEFNode) nodes[j]).setRadialInput(getRadialInput(ensemble, j, x[i]));
         
          nodes[j].run(0f, 0f);   
        }
        origin.run(null, 0f, 1f);
        actualOutput[i] = ((RealOutput) origin.getValues()).getValues();
       
        ensemble.setMode(SimulationMode.DIRECT);
        float[] state = new float[ensemble.getDimension()];
        state[0] = x[i];
View Full Code Here

Examples of ca.nengo.model.neuron.ExpandableSynapticIntegrator.run()

   
    t[0].setValues(spike);
    t[1].setValues(spike);
    t[2].setValues(spike);
   
    TimeSeries1D current = si.run(0f, .01f);
    assertEquals(11, current.getTimes().length);
    assertTrue(current.getValues1D()[0] > 1.99f && current.getValues1D()[0] < 2.01f);
    for (int i = 1; i < current.getTimes().length; i++) {
      assertTrue(current.getValues1D()[i] < current.getValues1D()[i-1]); //decaying
    }
View Full Code Here

Examples of ca.nengo.model.neuron.impl.IzhikevichSpikeGenerator.run()

    List<Integer> firings2 = new ArrayList<Integer>(10);
    for (int i = 0; i < 1000; i++) {
      SpikeOutput o1 = (SpikeOutput) rs.run(new float[]{i/1000f, (i+1)/1000f}, new float[]{I, I});
      if (o1.getValues()[0]) firings1.add(Integer.valueOf(i));
     
      SpikeOutput o2 = (SpikeOutput) fs.run(new float[]{i/1000f, (i+1)/1000f}, new float[]{I, I});
      if (o2.getValues()[0]) firings2.add(Integer.valueOf(i));
    }
   
    assertEquals(10, firings1.size());
    assertEquals(33, firings2.size());
View Full Code Here

Examples of ca.nengo.model.neuron.impl.LIFSpikeGenerator.run()

    TimeSeries history = sg.getHistory("V");
    assertTrue(history instanceof TimeSeries1D);
    assertEquals(0, history.getTimes().length);
    assertEquals(0, history.getValues().length);
   
    sg.run(new float[]{0f, .002f}, new float[]{1f, 1f});
    history = sg.getHistory("V");
    assertEquals(4, history.getTimes().length);
    assertEquals(4, history.getValues().length);
    assertTrue(history.getTimes()[1] > history.getTimes()[0]);
    assertTrue(history.getValues()[1][0] > history.getValues()[0][0]);
View Full Code Here

Examples of ca.nengo.model.neuron.impl.LinearSynapticIntegrator.run()

   
    t[0].setValues(spike);
    t[1].setValues(spike);
    t[2].setValues(spike);
   
    TimeSeries1D current = si.run(0f, .01f);
    assertEquals(11, current.getTimes().length);
    assertTrue(current.getValues1D()[0] > 1.99f && current.getValues1D()[0] < 2.01f);
    for (int i = 1; i < current.getTimes().length; i++) {
      assertTrue(current.getValues1D()[i] < current.getValues1D()[i-1]); //decaying
    }
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.