JitFPHomoLinear

JitFPHomoLinear#

class brainpy.dnn.JitFPHomoLinear(num_in, num_out, prob, weight, seed=None, sharding=None, mode=None, name=None, transpose=False, atomic=False)[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 variable, \(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 the same \(weight\).

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.

  • weight (float) – float. The synaptic value at each position.

  • 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.