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:

  1. Implementing build_conn(self) function, which returns one of the connection data csr (CSR sparse data, a tuple of <post_ids, inptr>), coo (COO sparse data, a tuple of <pre_ids, post_ids>), or mat (a binary connection matrix). For instance,

    import brainpy as bp
    class MyConnector(bp.conn.TwoEndConnector):
      def build_conn(self):
        return dict(csr=, mat=, coo=)
    
  2. Implementing functions build_mat(), build_csr(), and build_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
    
__init__(pre=None, post=None)[source]#

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