third_factor_bernoulli_with_pool

third_factor_bernoulli_with_pool#

class brainpy.state.network.third_factor_bernoulli_with_pool(*, p, pool_size, pool_type)[source]#

Return a third_factor_bernoulli_with_pool spec (NEST tripartite astro-pool rule).

Used as the third_factor_conn_spec of tripartite_connect(): for each realized primary pre->post edge, an independent Bernoulli(p) trial decides whether it is paired with one astrocyte drawn from the target neuron’s pool of pool_size astrocytes.

Parameters:
  • p (float) – Conditional pairing probability p_third_if_primary in [0, 1].

  • pool_size (int) – Astrocytes per target pool (>= 1; the upper bound <= n_third is checked when the populations are known).

  • pool_type ({'random', 'block'}) – Pool-assignment scheme (see build_pool_map()).

Returns:

The spec object.

Return type:

_ThirdFactorBernoulliWithPool

Raises:

ValueError – If p is outside [0, 1], pool_size < 1, or pool_type is unknown.

See also

brainpy.state.Simulator.tripartite_connect

Examples

>>> from brainpy import state as bp
>>> rule = bp.third_factor_bernoulli_with_pool(
...     p=0.5, pool_size=10, pool_type='random')
>>> rule.p, rule.pool_size, rule.pool_type
(0.5, 10, 'random')

The returned spec is passed as the third_factor_conn_spec of tripartite_connect().