CorePeripheryRandom#
- class braintools.conn.CorePeripheryRandom(core_size, core_core_prob=0.5, core_periphery_prob=0.2, periphery_core_prob=0.2, periphery_periphery_prob=0.05, weight=None, delay=None, **kwargs)#
Core-periphery network with densely connected core and sparse periphery.
This class creates a network with a core-periphery structure where a subset of nodes (the core) are densely interconnected, while the remaining nodes (the periphery) are sparsely connected to each other but maintain connections to the core. This architecture is common in brain networks, social networks, and infrastructure systems.
Core-periphery organization enables efficient information integration through the densely connected core while maintaining specialized processing in the periphery. The core acts as a hub for global communication and coordination, while peripheral nodes maintain local specialization.
- Parameters:
core_size (
int|float) – Size of the core. If int, specifies the exact number of core neurons. If float in (0, 1), specifies the proportion of neurons in the core. Core neurons are the first core_size neurons in the population.core_core_prob (
float) – Connection probability within the core (core→core). Higher values create a more densely connected core, which is characteristic of core-periphery networks.core_periphery_prob (
float) – Connection probability from core to periphery (core→periphery). This parameter controls how strongly core neurons project to periphery.periphery_core_prob (
float) – Connection probability from periphery to core (periphery→core). This parameter controls how periphery neurons feed back to core.periphery_periphery_prob (
float) – Connection probability within the periphery (periphery→periphery). Typically much lower than core_core_prob, creating sparse peripheral connectivity.weight (
Initialization|float|int|ndarray|Array|Quantity|None) – Weight initialization for each connection. Can be a scalar value, array, or an Initializer instance for more complex initialization patterns. If None, no weights are generated.delay (
Initialization|float|int|ndarray|Array|Quantity|None) – Delay initialization for each connection. Can be a scalar value, array, or an Initializer instance for more complex initialization patterns. If None, no delays are generated.**kwargs – Additional keyword arguments passed to the parent PointConnectivity class, such as ‘seed’ for random number generation.
Notes
This connectivity pattern requires pre_size == post_size (recurrent connectivity)
Core neurons are selected from the first core_size neurons (indices 0 to core_size-1)
Self-connections are automatically excluded
Core-periphery structure can be quantified using correlation measures
Typical parameter regime: core_core_prob >> core_periphery_prob ≈ periphery_core_prob > periphery_periphery_prob
Unlike the previous bidirectional parameter, now core→periphery and periphery→core probabilities are controlled independently for more flexibility
References
Examples
Create a core-periphery network with 20% core:
>>> import brainunit as u >>> from braintools.conn import CorePeripheryRandom >>> cp = CorePeripheryRandom( ... core_size=0.2, ... core_core_prob=0.5, ... periphery_periphery_prob=0.05 ... ) >>> result = cp(pre_size=1000, post_size=1000)
Create a network with fixed core size and asymmetric core-periphery connections:
>>> cp = CorePeripheryRandom( ... core_size=100, ... core_core_prob=0.6, ... core_periphery_prob=0.25, # Strong core→periphery ... periphery_core_prob=0.15, # Weaker periphery→core ... periphery_periphery_prob=0.03, ... weight=1.0 * u.nS, ... delay=2.0 * u.ms ... ) >>> result = cp(pre_size=1000, post_size=1000)
Create a network with strong feedback from periphery to core:
>>> cp = CorePeripheryRandom( ... core_size=0.15, ... core_core_prob=0.7, ... core_periphery_prob=0.2, ... periphery_core_prob=0.3, # Strong feedback ... periphery_periphery_prob=0.02 ... ) >>> result = cp(pre_size=800, post_size=800)
Use with custom weight initializer:
>>> from braintools.init import Normal >>> cp = CorePeripheryRandom( ... core_size=200, ... core_core_prob=0.5, ... weight=Normal(mean=1.0, std=0.2) ... ) >>> result = cp(pre_size=1000, post_size=1000)