MaskedLinear

MaskedLinear#

class brainpy.dnn.MaskedLinear(conn, weight, mask_fun=Identity0(mode=NonBatchingMode), sharding=None, mode=None, name=None)[source]#

Synaptic matrix multiplication with masked dense computation.

It performs the computation of:

\[y = x @ M\]

where \(y\) is the postsynaptic value, \(x\) the presynaptic value, \(M\) the synaptic weight using a dense matrix.

>>> import brainpy as bp
>>> l = bp.dnn.MaskedLinear(bp.conn.FixedProb(0.1, pre=100, post=100),
>>>                         weight=0.1)
Parameters:
update(x)[source]#

The function to specify the updating rule.