GaussianDecay

Contents

GaussianDecay#

class brainpy.initialize.GaussianDecay(sigma, max_w, min_w=None, encoding_values=None, periodic_boundary=False, include_self=True, normalize=False)[source]#

Builds a Gaussian connectivity pattern within a population of neurons, where the weights decay with gaussian function.

Specifically, for any pair of neurons \((i, j)\), the weight is computed as

\[w(i, j) = w_{max} \cdot \exp(-\frac{\sum_{k=1}^n |v_k^i - v_k^j|^2 }{2\sigma^2})\]

where \(v_k^i\) is the $i$-th neuron’s encoded value at dimension $k$.

Parameters:
  • sigma (float) – Width of the Gaussian function.

  • max_w (float) – The weight amplitude of the Gaussian function.

  • min_w (float, None) – The minimum weight value below which synapses are not created (default: \(0.005 * max\_w\)).

  • include_self (bool) – Whether create the conn at the same position.

  • encoding_values (optional, list, tuple, int, float) –

    The value ranges to encode for neurons at each axis.

    • If values is not provided, the neuron only encodes each positional information, i.e., \((i, j, k, ...)\), where \(i, j, k\) is the index in the high-dimensional space.

    • If values is a single tuple/list of int/float, neurons at each dimension will encode the same range of values. For example, values=(0, np.pi), neurons at each dimension will encode a continuous value space [0, np.pi].

    • If values is a tuple/list of list/tuple, it means the value space will be different for each dimension. For example, values=((-np.pi, np.pi), (10, 20), (0, 2 * np.pi)).

  • periodic_boundary (bool) – Whether the neuron encode the value space with the periodic boundary.

  • normalize (bool) – Whether normalize the connection probability.