GaussianKernel#
- class braintools.conn.GaussianKernel(sigma, max_distance=None, normalize=True, allow_self_connections=False, weight=None, delay=None, **kwargs)#
Gaussian kernel connectivity for center-surround receptive fields.
Creates connections weighted by a Gaussian function of distance, useful for implementing smooth spatial receptive fields.
Only the first two position dimensions (x, y) are used; any extra columns (e.g. z) are ignored.
- 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). Normalization uses the 2-D constant1 / (2 * pi * sigma**2)(positions are treated as 2-D, see above).allow_self_connections (
bool) – Whether a neuron may connect to itself when pre and post are the same population (default: False). A coincident pre/post would otherwise connect at the Gaussian peak.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 ... )