Package ca.nengo.model

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


    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");
    float[] mixed = MU.transpose(DataUtils.filter(probe.getData(), .01f).getValues())[0];
    getError(reference, mixed);

    p.addBias(300, .005f, .01f, true, false);
View Full Code Here

    p.addBias(300, .005f, .01f, true, false);
    BiasOrigin bo = (BiasOrigin) pre.getOrigin("post_input");
    BiasTermination bt = (BiasTermination) post.getTermination("input (bias)");
    assertTrue(MU.min(getNetWeights(directWeights, bo, bt)) > -1e-10);
    network.run(-1.5f, 1);
//    Plotter.plot(probe.getData(), "positive non-optimal");
//    float[] positiveNonOptimal = MU.transpose(DataUtils.filter(probe.getData(), .01f).getValues())[0];
//    float error = getError(reference, positiveNonOptimal);
//    assertTrue(error > 1e-10 && error < 5e-4);
    p.removeBias();
View Full Code Here

    p.addBias(300, .005f, .01f, true, true);
    bo = (BiasOrigin) pre.getOrigin("post_input");
    bt = (BiasTermination) post.getTermination("input (bias)");
    assertTrue(MU.min(getNetWeights(directWeights, bo, bt)) > -1e-10);
    network.run(-1.5f, 1);
//    Plotter.plot(probe.getData(), "positive optimal");
//    float[] positiveOptimal = MU.transpose(DataUtils.filter(probe.getData(), .01f).getValues())[0];
//    float error2 = getError(reference, positiveOptimal);
//    assertTrue(error2 > 1e-10 && error2 < 2.5e-4 && error2 < error);
    p.removeBias();
View Full Code Here

    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

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

            network.setMode(SimulationMode.RATE);
            Probe rates = network.getSimulator().addProbe("test", "rate", true);
            network.run(0, 2);
            //          Plotter.plot(rates.getData(), .05f, "rates");
            Plotter.plot(rates.getData(), "rates");
        } catch (StructuralException e) {
            e.printStackTrace();
        } catch (SimulationException e) {
View Full Code Here

      FunctionInput fi = new FunctionInput(name, funcs, Units.uAcm2);
      network.addNode(fi);
     
      //we can add a probe to it and run the simulator ...
      Probe p = network.getSimulator().addProbe(name, FunctionInput.STATE_NAME, true);     
      network.run(0, 10);
     
      JFrame frame = makeAnimPlotFrame("vector plot");
      frame.setLayout(new BorderLayout());
      Scope scope = new Scope(p);
      frame.getContentPane().add(scope.getGraphPanel(), BorderLayout.CENTER);
View Full Code Here

      network.addNode(ensemble);
     
      FunctionInput input = new FunctionInput("input", new Function[]{new ConstantFunction(1, 1)}, Units.UNK);
      network.addNode(input);
     
      network.run(0, 1);
     
      Environment.setUserInterface(true);
      Memory.report("Before plots");
      for (int i = 0; i < 5; i++) {
        Thread pt = new Thread() {
View Full Code Here

   
//    Probe sourceProbe = network.getSimulator().addProbe("source", NEFEnsemble.X, true);
//    Probe destProbe = network.getSimulator().addProbe("dest", NEFEnsemble.X, true);
//    Probe interProbe = network.getSimulator().addProbe("source_X_bias_interneurons", NEFEnsemble.X, true);
   
    network.run(0, 2);
   
//    Plotter.plot(sourceProbe.getData(), "source");
//    Plotter.plot(destProbe.getData(), "dest");
//    Plotter.plot(interProbe.getData(), "interneurons");
  }
View Full Code Here

   
    network.addProjection(input.getOrigin(FunctionInput.ORIGIN_NAME), pre.getTermination("input"));
    Projection projection = network.addProjection(pre.getOrigin(NEFEnsemble.X), post.getTermination("pre"));
   
    Probe pPost = network.getSimulator().addProbe("post", NEFEnsemble.X, true);
    network.run(0, 2);
    TimeSeries ideal = pPost.getData();
    Plotter.plot(pPost.getData(), .005f, "mixed weights result");   
   
    //remove negative weights ...
    System.out.println("Minimum weight without bias: " + MU.min(projection.getWeights()));
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.