Package ca.nengo.model

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


    Network network = new NetworkImpl();
    NEFEnsembleFactory factory = new NEFEnsembleFactoryImpl();
    NEFEnsemble ensemble = factory.make("Ensemble",100,2);
    File file = new File("testWTDSL.csv");
   
    network.addNode(ensemble);
   
    Probe probe = network.getSimulator().addProbe("Ensemble", "X", true);
    WriteToDiskSimulatorListener listener = new WriteToDiskSimulatorListener(file,probe,0.005f);
   
    network.getSimulator().addSimulatorListener(listener);
View Full Code Here


    Network network = new NetworkImpl();
    NEFEnsembleFactory factory = new NEFEnsembleFactoryImpl();
    NEFEnsemble ensemble = factory.make("Ensemble",100,2);
    File file = new File("testWTDSL.csv");
   
    network.addNode(ensemble);
   
    float interval = 0.005f;
    float simLength = 1.0f;
    int numIntervals = (int)(simLength / interval);
    Probe probe = network.getSimulator().addProbe("Ensemble", "X", true);
View Full Code Here

//  }

  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);
    network.addNode(pre);
View Full Code Here

    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);
    network.addNode(pre);
    network.addProjection(input.getOrigin(FunctionInput.ORIGIN_NAME), pre.getTermination("input"));
    NEFEnsemble post = ef.make("post", n, 2);
    network.addNode(post);
    post.addDecodedTermination("input", MU.I(2), .01f, false);
    Projection p = network.addProjection(pre.getOrigin(NEFEnsemble.X), post.getTermination("input"));
View Full Code Here

    NEFEnsemble pre = ef.make("pre", n, 2);
    pre.addDecodedTermination("input", MU.uniform(2, 1, 1), .005f, false);
    network.addNode(pre);
    network.addProjection(input.getOrigin(FunctionInput.ORIGIN_NAME), pre.getTermination("input"));
    NEFEnsemble post = ef.make("post", n, 2);
    network.addNode(post);
    post.addDecodedTermination("input", MU.I(2), .01f, false);
    Projection p = network.addProjection(pre.getOrigin(NEFEnsemble.X), post.getTermination("input"));

    DecodedOrigin o = (DecodedOrigin) pre.getOrigin(NEFEnsemble.X);
    DecodedTermination t = (DecodedTermination) post.getTermination("input");
View Full Code Here

   */
  public void functionalTestSort() throws StructuralException, SimulationException {
    Network network = new NetworkImpl();
   
    FunctionInput input = new FunctionInput("input", new Function[]{new SineFunction(5)}, Units.UNK);
    network.addNode(input);
   
    NEFEnsembleFactory ef = new NEFEnsembleFactoryImpl();
    NEFEnsemble ensemble = ef.make("ensemble", 100, 1);
    ensemble.addDecodedTermination("input", MU.I(1), .005f, false);
    ensemble.collectSpikes(true);
View Full Code Here

   
    NEFEnsembleFactory ef = new NEFEnsembleFactoryImpl();
    NEFEnsemble ensemble = ef.make("ensemble", 100, 1);
    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();
View Full Code Here

            NEFEnsemble ensemble = ef.make("test", 20, 1);
            ensemble.addDecodedTermination("input", MU.I(1), .01f, false);
            Plotter.plot(ensemble);

            Network network = new NetworkImpl();
            network.addNode(ensemble);
            FunctionInput input = new FunctionInput("input", new Function[]{new SineFunction(3)}, Units.UNK);
            network.addNode(input);
            network.addProjection(input.getOrigin(FunctionInput.ORIGIN_NAME), ensemble.getTermination("input"));

            network.setMode(SimulationMode.RATE);
View Full Code Here

            Plotter.plot(ensemble);

            Network network = new NetworkImpl();
            network.addNode(ensemble);
            FunctionInput input = new FunctionInput("input", new Function[]{new SineFunction(3)}, Units.UNK);
            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);
View Full Code Here

    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", true)
    network.addNode(integrator);
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.