Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function getSpikeCount(neuron, inp, runtime) {
const TIME_STEP = 1e-3;
const NUM_STEPS = runtime / TIME_STEP;

let numSpikes = 0;
for(let i = 0; i < NUM_STEPS; i++) {
const output = neuron.step(inp, TIME_STEP);
if(output > 0) {
numSpikes++;
}
}
return numSpikes;
}
Insert cell
function getSpikeRate(neuron, inp, runtime=10) {
return getSpikeCount(neuron, inp, runtime) / runtime;
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more