function getLIFCollection(n, tau_rc=0.02, tau_ref=0.002, thresh=1, max_rate_range = [200, 400], intercept_range = [-1, 1]) {
return new NeuronCollection(() => {
const maxRate = randomBetween(max_rate_range[0], max_rate_range[1]);
const intercept = randomBetween(intercept_range[0], intercept_range[1]);
const [gain, bias] = getGainBias(tau_rc, tau_ref, thresh, maxRate, intercept);
const encoder = randomItem([-1, 1]);
const lif = new LIF(tau_rc, 0, tau_ref, thresh);
lif.step = (I, t_step) => LIF.prototype.step.call(lif, I * gain * encoder + bias, t_step);
lif.gain = gain;
lif.bias = bias;
lif.encoder = encoder;
return lif;
}, n);
}