StepProfile

StepProfile#

class braintools.init.StepProfile(threshold, inside_prob=1.0, outside_prob=0.0)#

Step function distance profile.

Connection probability has two distinct values: one inside the threshold distance and another outside.

Parameters:
  • threshold (Array | ndarray | bool | number | bool | int | float | complex | Quantity) – Distance threshold.

  • inside_prob (float) – Probability for distances <= threshold (default: 1.0).

  • outside_prob (float) – Probability for distances > threshold (default: 0.0).

Examples

>>> import numpy as np
>>> import brainunit as u
>>> from braintools.init import StepProfile
>>>
>>> profile = StepProfile(
...     threshold=100.0 * u.um,
...     inside_prob=0.8,
...     outside_prob=0.1
... )
>>> distances = np.array([50, 100, 150]) * 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