brainpy.math.matmat_prob_conn_uniform_weight#
- brainpy.math.matmat_prob_conn_uniform_weight(matrix, *, w_low, w_high, conn_prob, shape, seed=None, version='v1')[source]#
Perform the \(y=M@v\) operation, where \(M\) is just-in-time randomly generated with a uniform distribution for its value.
This operator support
jit()
,vmap()
,grad()
andpmap()
etc. transformations on CPU and GPU devices.Warning
This API may change in the future.
In this operation, \(M\) is the random matrix with a connection probability conn_prob, and at each connection the value is the same scalar weight.
When
transpose=True
, we perform an operation of \(y=M^T@v\).Note
Note that the just-in-time generated \(M\) (transpose=False) is different from the generated \(M^T\) (transpose=True).
If you pursue the same \(M\) and \(M^T\) when performing the just-in-time matrix generation, you should set
outdim_parallel=True
, with the sacrifice of the speed compared withoutdim_parallel=False
.- Parameters:
- Returns:
out – The output of \(y = M @ v\).
- Return type:
Array, ndarray