ExponentialProfile#

class braintools.init.ExponentialProfile(decay_constant, max_distance=None)#

Exponential distance profile.

Connection probability and weight scaling decay exponentially with distance.

Parameters:
  • decay_constant (Array | ndarray | bool | number | bool | int | float | complex | Quantity) – Distance constant for exponential decay.

  • max_distance (Array | ndarray | bool | number | bool | int | float | complex | Quantity | None) – Maximum connection distance (connections beyond this are set to 0).

Examples

>>> import numpy as np
>>> import brainunit as u
>>> from braintools.init import ExponentialProfile
>>>
>>> profile = ExponentialProfile(
...     decay_constant=100.0 * u.um,
...     max_distance=500.0 * u.um
... )
>>> distances = np.array([0, 50, 100, 200, 500]) * u.um
>>> probs = profile.probability(distances)
probability(distances)[source]#

Calculate connection probability based on distance.

Parameters:

distances (Array | ndarray | bool | number | bool | int | float | complex | Quantity) – Array of distances between neuron pairs.

Returns:

probability – Connection probabilities (values between 0 and 1).

Return type:

ndarray