DenseDelayGraph
experimental.network_dynamics.graph.DenseDelayGraph(
weights,
delays,
region_labels=None,
symmetric=None,
)Dense graph with transmission delays.
Extends DenseGraph with a delay matrix for modeling transmission delays between network nodes. Used for delay differential equations (DDEs).
Args: weights: Weight matrix [n_nodes, n_nodes] delays: Delay matrix [n_nodes, n_nodes] in same units as integration time region_labels: Optional sequence of region labels (list, tuple, or array). If None, defaults to [‘Region_0’, ‘Region_1’, …] symmetric: Whether to treat as symmetric (None = auto-detect)
Attributes
| Name | Description |
|---|---|
| delays | Delay matrix [n_nodes, n_nodes]. |
| max_delay | Maximum delay in the network. |
Methods
| Name | Description |
|---|---|
| plot | Plot connectivity matrix, delays, and their distributions. |
| random | Create a random delay graph with brain-like connectivity. |
| tree_flatten | Flatten DenseDelayGraph for JAX PyTree. |
| tree_unflatten | Reconstruct DenseDelayGraph from PyTree data. |
| verify | Verify delay graph structure. |
plot
experimental.network_dynamics.graph.DenseDelayGraph.plot(
log_scale_weights=False,
figsize=(12, 10),
)Plot connectivity matrix, delays, and their distributions.
Args: log_scale_weights: If True, log-transform weights before plotting (helps reveal structure) figsize: Figure size (width, height)
Returns: fig, axes: Matplotlib figure and axes (2x2 grid)
random
experimental.network_dynamics.graph.DenseDelayGraph.random(
n_nodes,
sparsity=0.7,
symmetric=True,
weight_dist='lognormal',
max_delay=50.0,
delay_dist='uniform',
allow_self_loops=False,
key=None,
)Create a random delay graph with brain-like connectivity.
Args: n_nodes: Number of nodes in the network sparsity: Fraction of connections present (0.7 = 70% dense) symmetric: Whether to create undirected (symmetric) connectivity weight_dist: Weight distribution (‘lognormal’, ‘uniform’, or ‘binary’) max_delay: Maximum transmission delay delay_dist: Delay distribution (‘uniform’ or ‘constant’) allow_self_loops: Whether to allow self-connections (diagonal) key: JAX random key (if None, creates one with seed 0)
Returns: DenseDelayGraph with random connectivity and delays
Example: >>> import jax >>> key = jax.random.key(42) >>> graph = DenseDelayGraph.random(n_nodes=10, max_delay=20.0, key=key)
tree_flatten
experimental.network_dynamics.graph.DenseDelayGraph.tree_flatten()Flatten DenseDelayGraph for JAX PyTree.
tree_unflatten
experimental.network_dynamics.graph.DenseDelayGraph.tree_unflatten(
aux_data,
children,
)Reconstruct DenseDelayGraph from PyTree data.
verify
experimental.network_dynamics.graph.DenseDelayGraph.verify(verbose=True)Verify delay graph structure.
Additional checks beyond Graph.verify(): - Non-negative delays - Finite delay values - Delay matrix shape consistency