def get_before_and_after(self): synfire_run = SynfireRunner() synfire_run.do_run(n_neurons, neurons_per_core=neurons_per_core, weight_to_spike=weight_to_spike, delay=delay, placement_constraint=placement_constraint, run_times=runtimes, get_weights=get_weights, get_delays=get_delays) weights = synfire_run.get_weights() self.assertEqual(n_neurons, len(weights[0])) self.assertEqual(n_neurons, len(weights[1])) self.assertTrue(numpy.allclose(weights[0][0][2], weights[1][0][2])) delays = synfire_run.get_delay() self.assertEqual(n_neurons, len(delays[0])) self.assertEqual(n_neurons, len(delays[1])) self.assertTrue(numpy.allclose(delays[0][0][2], delays[1][0][2]))
delays = synfire_run.get_delay() self.assertEqual(n_neurons, len(delays[0])) self.assertEqual(n_neurons, len(delays[1])) self.assertTrue(numpy.allclose(delays[0][0][2], delays[1][0][2])) def test_get_before_and_after(self): self.runsafe(self.get_before_and_after) if __name__ == '__main__': synfire_run = SynfireRunner() synfire_run.do_run(n_neurons, neurons_per_core=neurons_per_core, weight_to_spike=weight_to_spike, delay=delay, placement_constraint=placement_constraint, run_times=runtimes, get_weights=get_weights, get_delays=get_delays) weights = synfire_run.get_weights() delays = synfire_run.get_delay() print("weights[0]") print(weights[0]) print(weights[0].shape) print("weights[1]") print(weights[1]) print(weights[1].shape) print("delays[0]") print(delays[0]) print(delays[0].shape) print("delays[1]") print(delays[1]) print(delays[1].shape)