Package ca.nengo.model

Examples of ca.nengo.model.RealOutput


            if (nodes[i] instanceof SpikingNeuron) {
              noise=((SpikingNeuron)nodes[i]).getNoise();
              ((SpikingNeuron)nodes[i]).setNoise(null);
            }
            nodes[i].run(0f, 0f);
            RealOutput output = (RealOutput) nodes[i].getOrigin(Neuron.AXON).getValues();
            series.add(x[j]*radius, output.getValues()[0]);
            rates[i][j] = output.getValues()[0];
            nodes[i].reset(false);
            if (noise!=null) {
              ((SpikingNeuron)nodes[i]).setNoise(noise);
            }
          } catch (SimulationException e) {
View Full Code Here


    terminations2.put("b", MU.I(2));
    PassthroughNode node2 = new PassthroughNode("test2", 2, terminations2);
    node2.getTermination("a").setValues(new RealOutputImpl(new float[]{10, 5}, Units.UNK, 0));
    node2.getTermination("b").setValues(new RealOutputImpl(new float[]{1, 0}, Units.UNK, 0));
    node2.run(0, .01f);
    RealOutput out2 = (RealOutput) node2.getOrigin(PassthroughNode.ORIGIN).getValues();
    TestUtil.assertClose(11, out2.getValues()[0], .001f);
    TestUtil.assertClose(5, out2.getValues()[1], .001f);
   
    Map<String, float[][]> terminations3 = new HashMap<String, float[][]>(10);
    terminations3.put("a", new float[][]{new float[]{1, -1}});
    PassthroughNode node3 = new PassthroughNode("test3", 1, terminations3);
    node3.getTermination("a").setValues(new RealOutputImpl(new float[]{10, 3}, Units.UNK, 0));
    node3.run(0, .01f);
    RealOutput out3 = (RealOutput) node3.getOrigin(PassthroughNode.ORIGIN).getValues();
    TestUtil.assertClose(7, out3.getValues()[0], .001f);
  }
View Full Code Here

    try {
      neuron.setMode(SimulationMode.CONSTANT_RATE);
      neuron.setRadialInput(-1);
      neuron.run(0, 0);
      RealOutput low = (RealOutput) neuron.getOrigin(Neuron.AXON).getValues();
      neuron.setRadialInput(1);
      neuron.run(0, 0);
      RealOutput high = (RealOutput) neuron.getOrigin(Neuron.AXON).getValues();
      slope = (high.getValues()[0] - low.getValues()[0]) / 2f;
      System.out.println("high: " + high.getValues()[0] + " low: " + low.getValues()[0] + " slope: " + slope);
      neuron.setMode(mode);
    } catch (SimulationException e) {
      throw new RuntimeException(e);
    } catch (StructuralException e) {
      throw new RuntimeException(e);
View Full Code Here

    if ( !(values instanceof RealOutput) ) {
      throw new SimulationException("Only real-valued input is accepted at a DecodedTermination");
    }

    RealOutput ro = (RealOutput) values;
    myInputValues = new RealOutputImpl(MU.sum(ro.getValues(), myStaticBias), ro.getUnits(), ro.getTime());

    if (!myValuesSet) {
            myValuesSet = true;
        }
  }
View Full Code Here

      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];
      }

      node.setMode(mode);
    }
View Full Code Here

            node.setRadialInput(getRadialInput(vals[t], nodeIndex));
           
 
          node.run(times[t], times[t]+dt);
 
          RealOutput output = (RealOutput) node.getOrigin(origin).getValues();
          result[i][t] = output.getValues()[0];
        }
      }

      node.setMode(mode);
    }
View Full Code Here

TOP

Related Classes of ca.nengo.model.RealOutput

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.