GaussianKernel

GaussianKernel#

class braintools.conn.GaussianKernel(sigma, max_distance=None, normalize=True, weight=None, delay=None, **kwargs)#

Gaussian kernel connectivity for center-surround receptive fields.

Creates connections weighted by a 2D Gaussian function of distance, useful for implementing smooth spatial receptive fields.

Parameters:
  • sigma (Array | ndarray | bool | number | bool | int | float | complex | Quantity) – Standard deviation of Gaussian.

  • max_distance (Array | ndarray | bool | number | bool | int | float | complex | Quantity | None) – Maximum distance for connections (default: 3*sigma).

  • normalize (bool) – Whether to normalize the Gaussian (default: True).

  • weight (Initialization | float | int | ndarray | Array | Quantity | None) – Weight initialization (Gaussian is multiplied by this).

  • delay (Initialization | float | int | ndarray | Array | Quantity | None) – Delay initialization.

Examples

>>> positions = np.random.uniform(0, 1000, (500, 2)) * u.um
>>> gauss = GaussianKernel(
...     sigma=50 * u.um,
...     max_distance=150 * u.um,
...     weight=2.0 * u.nS
... )
>>> result = gauss(
...     pre_size=500, post_size=500,
...     pre_positions=positions, post_positions=positions
... )
generate(**kwargs)[source]#

Generate Gaussian kernel connections.

Return type:

ConnectionResult