NeuralEnsemble / PyNN

A Python package for simulator-independent specification of neuronal network models.
Other
276 stars 126 forks source link

Documentation for disp_function in DisplacementDependentProbabilityConnector #720

Closed mdjurfeldt closed 2 years ago

mdjurfeldt commented 3 years ago

Hi, in DisplacementDependentProbabilityConnector, there's the following documentation for disp_function:

        `disp_function`: a function that takes a 3xN numpy position matrix and maps each row
                         (displacement) to a probability between 0 and 1

However, looking at how it is used:

        disp = (self.projection.post.positions.T[j] - self.projection.pre.positions.T[i]).T
        return self._disp_function(disp)

and given that i and j likely are cell indices, isn't disp_function rather a function of a 3-dimensional displacement vector rather than a 3xN matrix?

apdavison commented 2 years ago

Hi @mdjurfeldt. Thanks for spotting this incorrect description.

i and j can be arrays of cell indices, so the argument to disp_function could be either a 3-element vector or a 3xN array. I've tried to improve the documentation in f49a373. Please comment if you think the updated docs are still inaccurate or unclear.