Package ca.nengo.model

Examples of ca.nengo.model.Network


    ExpandableSpikingNeuron neuron = new ExpandableSpikingNeuron(integrator, generator, 1, 0, "neuron");   
    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);
   
    network.run(0, 1);
   
    Plotter.plot(v.getData(), "voltage");
    Plotter.plot(u.getData(), "recovery");
  }
View Full Code Here


//  private static Window window;

  // private static Window[] windows;
  public static Network createNetwork() throws StructuralException {

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

    // Plotter.plot(integrator);
    // Plotter.plot(integrator, NEFEnsemble.X);

    float tau = .05f;

    Termination interm = integrator.addDecodedTermination("input",
        new float[][] { new float[] { tau } }, tau, false);
    // Termination interm = integrator.addDecodedTermination("input", new
    // float[][]{new float[]{1f}}, tau);
    network.addProjection(input.getOrigin(FunctionInput.ORIGIN_NAME), interm);

    Termination fbterm = integrator.addDecodedTermination("feedback",
        new float[][] { new float[] { 1f } }, tau, false);
    network.addProjection(integrator.getOrigin(NEFEnsemble.X), fbterm);

    // System.out.println("Network creation: " + (System.currentTimeMillis()
    // - start));
    return network;
  }
View Full Code Here

    if (myNodeMap.containsKey(name)) {
      Node node = myNodeMap.get(name);

      if(node instanceof Network)
      {
        Network net = (Network)node;
        Probe[] probes = net.getSimulator().getProbes();
        for (Probe probe : probes) {
                    try
          {
            net.getSimulator().removeProbe(probe);
          }
          catch(SimulationException se)
          {
            System.err.println(se);
            return;
          }
                }

        Node[] nodes = net.getNodes();
        for (Node node2 : nodes) {
                    net.removeNode(node2.getName());
                }
      }
      else if(node instanceof DecodableEnsembleImpl)
      {
        NEFEnsembleImpl pop = (NEFEnsembleImpl)node;
View Full Code Here

                    childCollecting = true;
                }

            } else if (node instanceof Network) {
                Network subNet = (Network) node;

                DefaultMutableTreeNode netNode = createSortableNode(top, subNet);

                if(!addSpikePatterns(netNode, subNet)) {
                    top.remove(top.getIndex(netNode));
View Full Code Here

TOP

Related Classes of ca.nengo.model.Network

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.