Example #1
0
def do_run(seed=None):

    # Simulate using both simulators
    synfire_run = SynfireRunner()
    synfire_run.do_run(
        n_neurons=1, input_class=SpikeSourcePoisson, rate=noise_rate,
        start_time=0, duration=simtime, seed=seed,
        use_spike_connections=False,
        cell_params=cell_params, run_times=[simtime], record=True,
        record_v=True, randomise_v_init=True, record_input_spikes=True,
        weight_to_spike=0.4)

    s_pop_voltages = synfire_run.get_output_pop_voltage_numpy()
    s_pop_spikes = synfire_run.get_output_pop_spikes_numpy()
    noise_spike_times = synfire_run.get_spike_source_spikes_numpy()

    return noise_spike_times, s_pop_spikes, s_pop_voltages
Example #2
0
        spike_checker.synfire_multiple_lines_spike_checker(spikes,
                                                           n_neurons,
                                                           len(input),
                                                           wrap_around=False)

    def test_second_none(self):
        self.runsafe(self.second_none)


if __name__ == '__main__':
    synfire_run.do_run(n_neurons,
                       neurons_per_core=neurons_per_core,
                       run_times=run_times,
                       use_wrap_around_connections=wrap_around,
                       input_class=input_class,
                       start_time=start_time,
                       duration=duration,
                       rate=rate,
                       extract_between_runs=extract_between_runs,
                       set_between_runs=set_between_runs,
                       record_input_spikes=record_input_spikes)
    gsyn = synfire_run.get_output_pop_gsyn_exc_numpy()
    v = synfire_run.get_output_pop_voltage_numpy()
    input = synfire_run.get_spike_source_spikes_numpy()
    hist = numpy.histogram(input[:, 1], bins=[0, 5000, 10000])
    print(hist[0][0], hist[0][1])
    spikes = synfire_run.get_output_pop_spikes_numpy()
    plot_utils.plot_spikes(input, spikes2=spikes)
    plot_utils.heat_plot(v)
    plot_utils.heat_plot(gsyn)