Package ca.nengo.model.impl

Examples of ca.nengo.model.impl.SpikeOutputImpl


    public void reset(boolean randomize) {
      myGenerator.reset(randomize);
      if (myOutput instanceof RealOutputImpl){
            myOutput = new RealOutputImpl(new float[]{0.0f}, Units.SPIKES_PER_S, 0);
        } else {
            myOutput = new SpikeOutputImpl(new boolean[]{false}, Units.SPIKES, 0);
        }
    }
View Full Code Here


  private SpikeOutput mySpikeOutput;
 
  protected void setUp() throws Exception {
    super.setUp();   
    mySpikeOutput = new SpikeOutputImpl(new boolean[]{true}, Units.SPIKES, 0);
  }
View Full Code Here

        float rate = myRateFunction.map(new float[]{current[i]});
        double probNoSpikes = Math.exp(-rate*timeSpan);
        spike = (PDFTools.random() > probNoSpikes);
      }

      result = new SpikeOutputImpl(new boolean[]{spike}, Units.SPIKES, time[time.length-1]);
    }

    return result;
  }
View Full Code Here

        spikeRate = 1f/(time[time.length-1] - time[0]);
      mySpikeRate = mySpikeRate*0.99f + spikeRate*0.01f; //using a moving average (this is fairly ad-hoc)
      return new RealOutputImpl(new float[]{mySpikeRate}, Units.SPIKES_PER_S, time[time.length-1]);
    }
    else
      return new SpikeOutputImpl(new boolean[]{spiking}, Units.SPIKES, time[time.length-1]);
  }
View Full Code Here

      }

      myRateHistory = new float[]{spikeTime>=0 ? 1f/dt : 0};

      if (myMode.equals(SimulationMode.DEFAULT)) {
                result = new SpikeOutputImpl(new boolean[]{spikeTime>=0f}, Units.SPIKES, time[time.length-1]);
            } else {
                result = new PreciseSpikeOutputImpl(new float[]{spikeTime}, Units.SPIKES, time[time.length-1]);
            }
    } else if (myMode.equals(SimulationMode.RATE)) {
      float rate = I > 1 ? 1f / ( myTauRef - myTauRC * ((float) Math.log(1f - 1f/I)) ) : 0;
View Full Code Here

TOP

Related Classes of ca.nengo.model.impl.SpikeOutputImpl

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.