EventJitFPNormalLinear#

class brainpy.dnn.EventJitFPNormalLinear(num_in, num_out, prob, w_mu, w_sigma, seed=None, sharding=None, transpose=False, atomic=True, mode=None, name=None)[source]#

Synaptic matrix multiplication with the just-in-time connectivity.

It performs the computation of:

\[y = x @ M\]

where \(y\) is the postsynaptic value, \(x\) the presynaptic spikes, \(M\) the synaptic weights which has the fixed sparse connectivity and weights. Particularly, the connectivity in \(M\) is sampled from a fixed probability \(prob\), and at each connection, the synaptic value is sample from a normal distribution \(N(\mu, \sigma)\).

Parameters:
  • num_in (int) – int. The number of the input feature. A positive integer.

  • num_out (int) – int. The number of the input feature. A positive integer.

  • prob (float) – float. The connectivity probability.

  • w_mu (float) – float. The center of the normal distribution.

  • w_sigma (float) – float. The standard variance of the normal distribution.

  • seed (Optional[int]) – int. The random seed used to keep the reproducibility of the connectivity.

  • transpose (bool) – bool. Transpose the JIT matrix or not. Default False.

  • atomic (bool) – bool. Compute the post-synaptic value with the atomic summation. Default False. May be changed in the future.

  • sharding (Union[Sequence[str], Device, Sharding, None]) – The sharding strategy.

  • mode (Optional[Mode]) – The synaptic computing mode.

  • name (Optional[str]) – The synapse model name.

update(x)[source]#

The function to specify the updating rule.