ProbDist

ProbDist#

class brainpy.connect.ProbDist(dist=1, prob=1.0, pre_ratio=1.0, seed=None, include_self=True, **kwargs)[source]#

Connection with a maximum distance under a probability p.

Added in version 2.1.13.

Parameters:
  • dist (float, int) – The maximum distance between two points.

  • prob (float) – The connection probability, within 0. and 1.

  • pre_ratio (float) – The ratio of pre-synaptic neurons to connect.

  • seed (optional, int) – The random seed.

  • include_self (bool) – Whether include the point at the same position.

build_coo(isOptimized=True)[source]#

Build a coo sparse connection data.

Returns:

conn – A tuple denoting the (pre_ids, post_ids).

Return type:

tuple