本文整理汇总了Python中pool.Pool.merge_spikes方法的典型用法代码示例。如果您正苦于以下问题:Python Pool.merge_spikes方法的具体用法?Python Pool.merge_spikes怎么用?Python Pool.merge_spikes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pool.Pool
的用法示例。
在下文中一共展示了Pool.merge_spikes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run_neuron_experiment
# 需要导入模块: from pool import Pool [as 别名]
# 或者: from pool.Pool import merge_spikes [as 别名]
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