Example #1
0
def run_neuron_experiment(N, input_rates, weights, threshold,
    T=None, nspikes=None, neuron_model=RegularNeuron):
    """Run an experiment with a single neuron
    """
    spike_rates = set_list_var(input_rates, N)
    weights = set_list_var(weights, N)
    
    neurons = [neuron_model(spike_rate, weight) for 
               spike_rate, weight in
               zip(spike_rates, weights)]
    pool = Pool(neurons=neurons, threshold=threshold)
    spks_in = pool.gen_nrn_spikes(T=T, nspikes=nspikes)
    
    merged_spks_in = pool.merge_spikes(spks_in)
    spks_out, acc_state = pool.gen_acc_spikes(merged_spks_in)
    return spks_in, acc_state, spks_out