예제 #1
0
 def test_get_weights_as_array_with_multapses(self, sim=sim):
     C = sim.FixedNumberPreConnector(n=7, rng=MockRNG(delta=1))
     prj = sim.Projection(self.p2, self.p3, C, synapse_type=self.syn1)
     # because we use a fake RNG, it is always the last three presynaptic cells which receive the double connection
     target = numpy.array([
         [0.006, 0.006, 0.006, 0.006, 0.006],
         [0.012, 0.012, 0.012, 0.012, 0.012],
         [0.012, 0.012, 0.012, 0.012, 0.012],
         [0.012, 0.012, 0.012, 0.012, 0.012],
         ])
     weights = prj.get("weight", format="array", gather=False)  # use gather False because we are faking the MPI
     assert_array_equal(weights, target)
예제 #2
0
 def test_get_weights_as_array_with_multapses_min(self, sim=sim):
     C = sim.FixedNumberPreConnector(n=7, rng=MockRNG(delta=1))
     prj = sim.Projection(self.p2, self.p3, C, synapse_type=self.syn1)
     target = np.array([
         [0.006, 0.006, 0.006, 0.006, 0.006],
         [0.006, 0.006, 0.006, 0.006, 0.006],
         [0.006, 0.006, 0.006, 0.006, 0.006],
         [0.006, 0.006, 0.006, 0.006, 0.006],
     ])
     # use gather False because we are faking the MPI
     weights = prj.get("weight", format="array", gather=False, multiple_synapses='min')
     assert_array_equal(weights, target)