brainpy.connect.TwoEndConnector
brainpy.connect.TwoEndConnector#
- class brainpy.connect.TwoEndConnector(pre=None, post=None)[source]#
Synaptic connector to build connections between two neuron groups.
If users want to customize their Connector, there are two ways:
Implementing
build_conn(self)
function, which returns one of the connection datacsr
(CSR sparse data, a tuple of <post_ids, inptr>),coo
(COO sparse data, a tuple of <pre_ids, post_ids>), ormat
(a binary connection matrix). For instance,import brainpy as bp class MyConnector(bp.conn.TwoEndConnector): def build_conn(self): return dict(csr=, mat=, coo=)
Implementing functions
build_mat()
,build_csr()
, andbuild_coo()
. Users can provide all three functions, or one of them.import brainpy as bp class MyConnector(bp.conn.TwoEndConnector): def build_mat(self, ): return conn_matrix def build_csr(self, ): return post_ids, inptr def build_coo(self, ): return pre_ids, post_ids
Methods
__init__
([pre, post])build_conn
()build connections with certain data type.
build_coo
()Build a coo sparse connection data.
build_csr
()Build a csr sparse connection data.
build_mat
()Build a binary matrix connection data.
require
(*structures)Require all the connection data needed.
requires
(*structures)Require all the connection data needed.
Attributes
is_version2_style