Package ca.nengo.model.nef.impl

Examples of ca.nengo.model.nef.impl.NEFEnsembleFactoryImpl.make()


        for(int i = 0; i < transform.length; i++) {
            transform[i] = new float[]{1.0f, 1.0f, 1.0f};
        }

        NEFEnsembleFactoryImpl ef = new NEFEnsembleFactoryImpl();
        NEFEnsembleImpl c = (NEFEnsembleImpl)ef.make("c", 10, 1);

        LinearExponentialTermination[] nodeterms = new LinearExponentialTermination[10];
        for(int i = 0; i < nodeterms.length; i++) {
            nodeterms[i] = new LinearExponentialTermination(new SpikingNeuron(null, null, 0.0f, 0.0f, null), null, transform[i], 0.0f);
        }
View Full Code Here


            transform[i] = new float[]{1.0f, 1.0f, 1.0f};
            newtransform[i] = new float[]{0.0f, 0.0f, 0.0f};
        }

        NEFEnsembleFactoryImpl ef = new NEFEnsembleFactoryImpl();
        NEFEnsembleImpl c = (NEFEnsembleImpl)ef.make("c", 10, 1);

        LinearExponentialTermination[] nodeterms = new LinearExponentialTermination[10];
        for(int i = 0; i < nodeterms.length; i++) {
            nodeterms[i] = new LinearExponentialTermination(new SpikingNeuron(null, null, 0.0f, 0.0f, null), null, transform[i], 0.0f);
        }
View Full Code Here

  public void functionalTestAddBiasOrigin() throws StructuralException, SimulationException {
    NEFEnsembleFactory ef = new NEFEnsembleFactoryImpl();

    boolean regenerate = false;
    NEFEnsemble source = ef.make("source", 300, 1, "nefeTest_source", regenerate);
    NEFEnsemble dest = ef.make("dest", 300, 1, "nefeTest_dest", regenerate);
   
    Function f = new AbstractFunction(1) {
      private static final long serialVersionUID = 1L;
      public float map(float[] from) {
View Full Code Here

  public void functionalTestAddBiasOrigin() throws StructuralException, SimulationException {
    NEFEnsembleFactory ef = new NEFEnsembleFactoryImpl();

    boolean regenerate = false;
    NEFEnsemble source = ef.make("source", 300, 1, "nefeTest_source", regenerate);
    NEFEnsemble dest = ef.make("dest", 300, 1, "nefeTest_dest", regenerate);
   
    Function f = new AbstractFunction(1) {
      private static final long serialVersionUID = 1L;
      public float map(float[] from) {
        return from[0] - 1;
View Full Code Here

   
    FunctionInput input = new FunctionInput("input", new Function[]{f}, Units.UNK);
    network.addNode(input);
   
    NEFEnsembleFactory ef = new NEFEnsembleFactoryImpl();
    NEFEnsemble pre = ef.make("pre", 400, 1, "nefe_pre", false);
    pre.addDecodedTermination("input", MU.I(1), tauPSC, false);
//    DecodedOrigin baseOrigin = (DecodedOrigin) pre.getOrigin(NEFEnsemble.X);
    network.addNode(pre);
   
    NEFEnsemble post = ef.make("post", 200, 1, "nefe_post", false);
View Full Code Here

    NEFEnsemble pre = ef.make("pre", 400, 1, "nefe_pre", false);
    pre.addDecodedTermination("input", MU.I(1), tauPSC, false);
//    DecodedOrigin baseOrigin = (DecodedOrigin) pre.getOrigin(NEFEnsemble.X);
    network.addNode(pre);
   
    NEFEnsemble post = ef.make("post", 200, 1, "nefe_post", false);
//    DecodedTermination baseTermination = (DecodedTermination) post.addDecodedTermination("pre", MU.I(1), tauPSC, false);
    network.addNode(post);
   
    network.addProjection(input.getOrigin(FunctionInput.ORIGIN_NAME), pre.getTermination("input"));
    Projection projection = network.addProjection(pre.getOrigin(NEFEnsemble.X), post.getTermination("pre"));
View Full Code Here

//    return biasEncoders;
//  }
 
  public void testClone() throws StructuralException, CloneNotSupportedException {
    NEFEnsembleFactory ef = new NEFEnsembleFactoryImpl();
    NEFEnsemble ensemble = ef.make("test", 100, 1);
    long startTime = System.currentTimeMillis();
    ensemble.clone();
    System.out.println(System.currentTimeMillis() - startTime);
  }
 
View Full Code Here

  }
 
  public void testKillNeurons() throws StructuralException
  {
    NEFEnsembleFactoryImpl ef = new NEFEnsembleFactoryImpl();
    NEFEnsembleImpl nef1 = (NEFEnsembleImpl)ef.make("nef1", 1000, 1);
   
    nef1.killNeurons(0.0f,true);
    int numDead = countDeadNeurons(nef1);
    if(numDead != 0) {
      fail("Number of dead neurons outside expected range");
View Full Code Here

    numDead = countDeadNeurons(nef1);
    if(numDead != 1000) {
      fail("Number of dead neurons outside expected range");
    }
   
    NEFEnsembleImpl nef2 = (NEFEnsembleImpl)ef.make("nef2", 1, 1);
    nef2.killNeurons(1.0f,true);
    numDead = countDeadNeurons(nef2);
    if(numDead != 0)
      fail("Relay protection did not work");
    nef2.killNeurons(1.0f,false);
View Full Code Here

  }
 
  public void testAddDecodedSignalOrigin() throws StructuralException
  {
    NEFEnsembleFactoryImpl ef = new NEFEnsembleFactoryImpl();
    NEFEnsembleImpl ensemble = (NEFEnsembleImpl)ef.make("test", 5, 1);
    float[][] vals = new float[2][1];
    vals[0][0] = 1;
    vals[1][0] = 1;
    TimeSeriesImpl targetSignal = new TimeSeriesImpl(new float[]{0,1}, vals, new Units[]{Units.UNK});
    TimeSeriesImpl[] evalSignals = new TimeSeriesImpl[1];
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.