if self._post_neurons is None:
n = 0
while (n < self._post_n):
permutation = numpy.arange(self._n_post_neurons)
for i in range(0, self._n_post_neurons - 1):
j = int(self._rng.next(
n=1, distribution="uniform",
parameters=[0, self._n_post_neurons]))
(permutation[i], permutation[j]) = (
permutation[j], permutation[i])
n += self._n_post_neurons
if self._post_neurons is None:
self._post_neurons = permutation
else:
self._post_neurons = numpy.append(
self._post_neurons, permutation)
self._post_neurons = self._post_neurons[:self._post_n]
After Change
// Loop over all the pre neurons
for m in range(0, self._n_pre_neurons):
if self._post_neurons[m] is None:
self._post_neurons[m] = numpy.random.choice(
self._n_post_neurons, self._n_post, False)
self._post_neurons[m].sort()
// This looks nice but it doesn"t work with PyNN 0.9 ?
// n = 0