brainpy.connect module#

This module provides methods to construct connectivity between neuron groups. You can access them through brainpy.connect.XXX.

Base Connection Classes and Tools#

set_default_dtype

Set the default dtype.

get_idx_type

mat2coo

mat2csc

mat2csr

convert a dense matrix to (indices, indptr).

csr2csc

Convert csr to csc.

csr2mat

convert (indices, indptr) to a dense matrix.

csr2coo

coo2csr

convert pre_ids, post_ids to (indices, indptr) when'jax_platform_name' = 'gpu'

coo2csc

Convert csr to csc.

coo2mat

convert (indices, indptr) to a dense matrix.

Connector

Base Synaptic Connector Class.

TwoEndConnector

Synaptic connector to build connections between two neuron groups.

OneEndConnector

Synaptic connector to build synapse connections within a population of neurons.

Custom Connections#

MatConn

Connector built from the dense connection matrix.

IJConn

Connector built from the pre_ids and post_ids connections.

CSRConn

Connector built from the CSR sparse connection matrix.

SparseMatConn

Connector built from the sparse connection matrix

Random Connections#

FixedProb

Connect the post-synaptic neurons with fixed probability.

FixedPreNum

Connect a fixed number pf pre-synaptic neurons for each post-synaptic neuron.

FixedPostNum

Connect the fixed number of post-synaptic neurons for each pre-synaptic neuron.

FixedTotalNum

Connect the synaptic neurons with fixed total number.

GaussianProb

Builds a Gaussian connectivity pattern within a population of neurons, where the connection probability decay according to the gaussian function.

ProbDist

Connection with a maximum distance under a probability p.

SmallWorld

Build a Watts–Strogatz small-world graph.

ScaleFreeBA

Build a random graph according to the Barabási–Albert preferential attachment model.

ScaleFreeBADual

Build a random graph according to the dual Barabási–Albert preferential attachment model.

PowerLaw

Holme and Kim algorithm for growing graphs with powerlaw degree distribution and approximate average clustering.

Regular Connections#

One2One

Connect two neuron groups one by one.

All2All

Connect each neuron in first group to all neurons in the post-synaptic neuron groups.

GridFour

The nearest four neighbors connection method.

GridEight

The nearest eight neighbors conn method.

GridN

The nearest (2*N+1) * (2*N+1) neighbors conn method.

one2one

Connect two neuron groups one by one.

all2all

Connect each neuron in first group to all neurons in the post-synaptic neuron groups.

grid_four

The nearest four neighbors connection method.

grid_eight

The nearest eight neighbors conn method.