ExcitatoryInhibitory#

class braintools.conn.ExcitatoryInhibitory(exc_ratio=0.8, exc_prob=0.1, inh_prob=0.2, exc_weight=None, inh_weight=None, exc_delay=None, inh_delay=None, **kwargs)#

Standard excitatory-inhibitory network following Dale’s principle.

This connectivity pattern implements a biologically-inspired network where neurons are divided into excitatory and inhibitory populations. Each population has its own connection probability and can have distinct weights and delays. This follows Dale’s principle that a neuron releases the same neurotransmitter(s) at all of its synapses.

The connectivity is generated probabilistically: for each potential connection from a presynaptic neuron to a postsynaptic neuron, a connection is formed with probability exc_prob (for excitatory neurons) or inh_prob (for inhibitory neurons).

Parameters:
  • exc_ratio (float) – Fraction of presynaptic neurons that are excitatory. Must be between 0 and 1. The first int(pre_size * exc_ratio) neurons are treated as excitatory, and the remaining neurons are inhibitory.

  • exc_prob (float) – Connection probability for excitatory-to-postsynaptic connections. Must be between 0 and 1.

  • inh_prob (float) – Connection probability for inhibitory-to-postsynaptic connections. Must be between 0 and 1.

  • exc_weight (Initialization | float | int | ndarray | Array | Quantity | None) – Weight initialization for excitatory connections. Can be a scalar, array, or Initializer object. Must be specified together with inh_weight (both None or both specified).

  • inh_weight (Initialization | float | int | ndarray | Array | Quantity | None) – Weight initialization for inhibitory connections. Can be a scalar, array, or Initializer object. Must be specified together with exc_weight (both None or both specified).

  • exc_delay (Initialization | float | int | ndarray | Array | Quantity | None) – Delay initialization for excitatory connections. Can be a scalar, array, or Initializer object. Must be specified together with inh_delay (both None or both specified).

  • inh_delay (Initialization | float | int | ndarray | Array | Quantity | None) – Delay initialization for inhibitory connections. Can be a scalar, array, or Initializer object. Must be specified together with exc_delay (both None or both specified).

Notes

  • Both exc_weight and inh_weight must be either both None or both specified. If only one is provided, a ValueError will be raised.

  • Similarly, both exc_delay and inh_delay must be either both None or both specified.

  • Typical cortical networks have an exc_ratio of ~0.8 (80% excitatory, 20% inhibitory).

  • Inhibitory connections often have higher connection probabilities than excitatory ones.

Examples

Create a basic E-I network with 80% excitatory neurons:

>>> import brainunit as u
>>> from braintools.conn import ExcitatoryInhibitory
>>>
>>> ei_net = ExcitatoryInhibitory(
...     exc_ratio=0.8,
...     exc_prob=0.1,
...     inh_prob=0.2,
...     exc_weight=1.0 * u.nS,
...     inh_weight=-0.8 * u.nS
... )
>>> result = ei_net(pre_size=1000, post_size=1000)

Create an E-I network with delays:

>>> ei_net = ExcitatoryInhibitory(
...     exc_ratio=0.8,
...     exc_prob=0.1,
...     inh_prob=0.2,
...     exc_weight=1.0 * u.nS,
...     inh_weight=-0.8 * u.nS,
...     exc_delay=1.5 * u.ms,
...     inh_delay=0.8 * u.ms
... )
>>> result = ei_net(pre_size=1000, post_size=1000)

Create an E-I network with only connectivity (no weights or delays):

>>> ei_net = ExcitatoryInhibitory(
...     exc_ratio=0.8,
...     exc_prob=0.1,
...     inh_prob=0.2
... )
>>> result = ei_net(pre_size=1000, post_size=1000)
generate(**kwargs)[source]#

Generate excitatory-inhibitory network.

Return type:

ConnectionResult