Package ca.nengo.model.impl

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


                weights[i] = new float[]{1};
            }
            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"));
View Full Code Here


            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);
//          Probe nProbe = network.getSimulator().addProbe("ensemble", 0, "N", true);
View Full Code Here

    NEFEnsembleImpl nef1 = (NEFEnsembleImpl)ef.make("nef1", 1000, 1);
    NEFEnsembleImpl nef2 = (NEFEnsembleImpl)ef.make("nef2", 1000, 1);
    NEFEnsembleImpl nef3 = (NEFEnsembleImpl)ef.make("nef3", 1, 1);
    NetworkImpl net = new NetworkImpl();
   
    net.addNode(nef1);
    myNetwork.addNode(net);
    myNetwork.addNode(nef2);
    myNetwork.addNode(nef3);
   
    myNetwork.killNeurons(0.0f,true);
View Full Code Here

    b.setName("b");
    myNetwork.addNode(b);
   
    NEFEnsembleFactoryImpl ef = new NEFEnsembleFactoryImpl();
    NEFEnsembleImpl c = (NEFEnsembleImpl)ef.make("c", 10, 1);
    b.addNode(c);
    b.getSimulator().addProbe("c", "X", true);
   
    b.exposeOrigin(c.getOrigin("X"), "exposed");
   
    if(!b.getExposedOriginName(c.getOrigin("X")).equals("exposed"))
View Full Code Here

    NEFEnsembleImpl a = (NEFEnsembleImpl)ef.make("a", 10, 1);
    float[][] tmp = new float[1][1];
    tmp[0][0] = 1;
    a.addDecodedTermination("in", tmp, 0.007f, false);
   
    net.addNode(a);
   
    if(net.getNodeTerminations().size() != 1)
      fail("Network hasn't found node termination");
  }
 
View Full Code Here

      fail("Network has origins when it shouldn't");
   
    NEFEnsembleFactoryImpl ef = new NEFEnsembleFactoryImpl();
    NEFEnsembleImpl a = (NEFEnsembleImpl)ef.make("a", 10, 1);
   
    net.addNode(a);
   
    if(net.getNodeOrigins().size() != a.getOrigins().length)
      fail("Network hasn't found node origin");
   
  }
View Full Code Here

   
    NEFEnsembleFactoryImpl ef = new NEFEnsembleFactoryImpl();
    NEFEnsembleImpl a = (NEFEnsembleImpl)ef.make("a", 10, 1);
    a.addDecodedTermination("input", new float[][]{new float[]{1}}, 0.01f, false);
   
    net.addNode(a);
   
    FunctionInput fin = new FunctionInput("fin", new Function[]{new ConstantFunction(1,0)}, Units.UNK);
    net.addNode(fin);
   
    net.addProjection(fin.getOrigin("origin"), a.getTermination("input"));
View Full Code Here

    a.addDecodedTermination("input", new float[][]{new float[]{1}}, 0.01f, false);
   
    net.addNode(a);
   
    FunctionInput fin = new FunctionInput("fin", new Function[]{new ConstantFunction(1,0)}, Units.UNK);
    net.addNode(fin);
   
    net.addProjection(fin.getOrigin("origin"), a.getTermination("input"));
   
    Probe p = net.getSimulator().addProbe("a", "rate", true);
   
View Full Code Here

    Termination t = neuron.addTermination("input", MU.I(1), .001f, false);
   
    FunctionInput input = new FunctionInput("input", new Function[]{new ConstantFunction(1, I)}, Units.UNK);
   
    Network network = new NetworkImpl();
    network.addNode(input);
    network.addNode(neuron);
    network.addProjection(input.getOrigin(FunctionInput.ORIGIN_NAME), t);
   
    Probe v = network.getSimulator().addProbe("neuron", IzhikevichSpikeGenerator.V, true);
    Probe u = network.getSimulator().addProbe("neuron", IzhikevichSpikeGenerator.U, true);
View Full Code Here

   
    FunctionInput input = new FunctionInput("input", new Function[]{new ConstantFunction(1, I)}, Units.UNK);
   
    Network network = new NetworkImpl();
    network.addNode(input);
    network.addNode(neuron);
    network.addProjection(input.getOrigin(FunctionInput.ORIGIN_NAME), t);
   
    Probe v = network.getSimulator().addProbe("neuron", IzhikevichSpikeGenerator.V, true);
    Probe u = network.getSimulator().addProbe("neuron", IzhikevichSpikeGenerator.U, true);
   
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.