neurai.nn.conn package#

Submodules#

class neurai.nn.conn.connrule.All2All#

Bases: Connector

Connect each neuron in the pre-population to all neurons in the post-population.

class neurai.nn.conn.connrule.Connector(**kwargs)#

Bases: object

Base Synaptic Connector Class.

Parameters:
  • pre_num (int) – Number of presynaptic neurons.

  • post_num (int) – Number of postsynaptic neurons.

  • build_list (list) – List of method names for building connectivity matrix.

class neurai.nn.conn.connrule.CustomConn(**kwargs)#

Bases: Connector

Connect the pre-population with the post-population from user custom data.

If conn_repr is ConnectRepr.COO, user must to give the ‘pre_ids, post_ids’ or ‘mat’; If conn_repr is ConnectRepr.CSR, user must to give the ‘post_ids, pre_indptr’ or ‘pre_ids, post_ids’ or ‘mat’; If conn_repr is ConnectRepr.CSC, user must to give the ‘pre_ids’ and ‘post_indptr’ or ‘pre_ids, post_ids’ or ‘mat’; If conn_repr is ConnectRepr.MAT, user must to give the ‘mat’;

Parameters:
  • pre_ids (np.ndarray(int), jnp.ndarray(int), jnp.ndarray(int), list(int)) – The indices of pre-population neurons to the indices of post-population neurons.

  • post_ids (np.ndarray(int), jnp.ndarray(int), jnp.ndarray(int), list(int)) – The indices of post-population neurons to the indices of pre-population neurons.

  • pre_indptr (np.ndarray(int), jnp.ndarray(int), jnp.ndarray(int), list(int)) – The index pointer array for the start of each row in the index array.

  • post_indptr (np.ndarray(int), jnp.ndarray(int), jnp.ndarray(int), list(int)) – The index pointer array for the start of each column in the index array.

  • mat (np.ndarray(bool), jnp.ndarray(bool), jnp.ndarray(bool)) – The dense connection matrix.

class neurai.nn.conn.connrule.FixedIndegree(degree, multi_conn=True)#

Bases: Connector

Connects a fixed number of pre-population for each post-population neuron.

Parameters:
  • degree (float or int) – The connection probability (if “degree” is float) or the fixed number of connectivity (if “degree” is int).

  • multi_conn (bool, Optional) – Whether to allow one pre-population neuron to connect to multiple post-population neurons.

class neurai.nn.conn.connrule.FixedOutdegree(degree, multi_conn=True)#

Bases: Connector

Connect a fixed number of post-population for each pre-population neuron.

Parameters:
  • degree (float or int) – The connection probability (if “degree” is float) or the fixed number of connections (if “degree” is int).

  • multi_conn (bool, Optional) – Whether to allow one pre-population neuron to connect to multiple post-population neurons.

class neurai.nn.conn.connrule.FixedProb(prob)#

Bases: Connector

Connect the pre-population with the post-population with fixed probability.

Parameters:

prob (float) – The connection probability of the pre-population to post-population.

class neurai.nn.conn.connrule.FixedTotalNum(num, multi_conn=True)#

Bases: Connector

Connects the pre-population with the post-population using fixed number.

Parameters:
  • num (int) – The fixed number of connections to be made.

  • multi_conn (bool, Optional) – Whether or not to allow multiple connections from a single pre-synaptic neuron. Defaults to True.

class neurai.nn.conn.connrule.One2One#

Bases: Connector

Connects neurons in two populations one by one.

This class defines a connection between neurons in two populations, such that each neuron in the pre-population is connected to exactly one neuron in the post-population.

Module contents#