EventFixedNumConn#
- class brainstate.nn.EventFixedNumConn(in_size, out_size, conn_num, conn_weight, efferent_target='post', afferent_ratio=1.0, allow_multi_conn=True, seed=None, name=None, conn_init='vmap', param_type=<class 'brainstate.ParamState'>)#
The FixedProb module implements a fixed probability connection with CSR sparse data structure.
- Parameters:
in_size (
int|Sequence[int] |integer|Sequence[integer]) – Number of pre-synaptic neurons, i.e., input size.out_size (
int|Sequence[int] |integer|Sequence[integer]) – Number of post-synaptic neurons, i.e., output size.If it is a float, representing the probability of connection, i.e., connection probability.
If it is an integer, representing the number of connections.
conn_weight (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity) – Maximum synaptic conductance, i.e., synaptic weight.conn_target (str, optional) –
The target of the connection. Default is ‘post’, meaning that each pre-synaptic neuron connects to a fixed number of post-synaptic neurons. The connection number is determined by the value of
n_conn.If ‘pre’, each post-synaptic neuron connects to a fixed number of pre-synaptic neurons.
conn_init (
str) –The initialization method of the connection weight. Default is ‘vmap’, meaning that the connection weight is initialized by parallelized across multiple threads.
If ‘for_loop’, the connection weight is initialized by a for loop.
allow_multi_conn (
bool) – Whether multiple connections are allowed from a single pre-synaptic neuron. Default is True, meaning that a value ofacan be selected multiple times.seed (
int|None) – Random seed. Default is None. If None, the default random seed will be used.