Exemplo n.º 1
0
    def test_split(self):
        times = [[1.0, 2.0, 3.0, 4.0, 5.0], [3.0, 4.0, 5.0, 6.0], [7.0, 8.0, 9.0]]
        indices = [[1, 2, 3, 4, 5], [3, 4, 5, 6], [7, 8, 9]]

        t1, i1 = NetworkInstance.split(times, indices, 2, 5)
        self.assertEqual([[2.0, 3.0, 4.0], [3.0, 4.0], []], t1)
        self.assertEqual([[0, 1, 2], [1, 2], []], i1)
Exemplo n.º 2
0
    def test_split(self):
        times = [[1.0, 2.0, 3.0, 4.0, 5.0], [3.0, 4.0, 5.0, 6.0],
                 [7.0, 8.0, 9.0]]
        indices = [[1, 2, 3, 4, 5], [3, 4, 5, 6], [7, 8, 9]]

        t1, i1 = NetworkInstance.split(times, indices, 2, 5)
        self.assertEqual([[2.0, 3.0, 4.0], [3.0, 4.0], []], t1)
        self.assertEqual([[0, 1, 2], [1, 2], []], i1)
Exemplo n.º 3
0
 def test_match_negative(self):
     input_times = [[100.0], [200.0], [300.0], [400.0]]
     input_indices = [[0], [1], [2], [3]]
     output = [{}, {"spikes": [[95.0], [195.0], [295.0], [395.0]]}]
     output_spikes, output_indices = NetworkInstance.match_static(
         input_times, input_indices, output[1]["spikes"])
     self.assertEqual(output_spikes, [[95.0], [195.0], [295.0], [395.0]])
     self.assertEqual(output_indices, [[0], [0], [1], [2]])
Exemplo n.º 4
0
 def test_match_negative(self):
     input_times = [[100.0], [200.0], [300.0], [400.0]]
     input_indices = [[0], [1], [2], [3]]
     output = [
         {}, {"spikes": [[95.0], [195.0], [295.0], [395.0]]}
     ]
     output_spikes, output_indices = NetworkInstance.match_static(
             input_times, input_indices, output[1]["spikes"])
     self.assertEqual(output_spikes, [[95.0], [195.0], [295.0], [395.0]])
     self.assertEqual(output_indices, [[0], [0], [1], [2]])