TopographicProjection#
- class braintools.conn.TopographicProjection(topographic_map, weight=None, delay=None, **kwargs)#
Topographic projection patterns.
Shorthand for
AxonalProjection(topographic_map=...); positions are required.- Parameters:
topographic_map (
Callable) – Function (pre_pos, post_pos) -> probability.weight (
Initialization|float|int|ndarray|Array|Quantity|None) – Weight initialization.delay (
Initialization|float|int|ndarray|Array|Quantity|None) – Delay initialization.
Notes
topographic_mapis a scalar function of one pre and one post position. It is called once per pair of distinct positions (within each chunk of presynaptic rows), so neurons at equal positions share one call; seeAxonalProjection.With
topographic_map=Nonethere is no spatial term and every pair connects with the defaultAxonalProjectionprobability (0.05).Generation runs on the host with NumPy and cannot be traced by
jax.jit,jax.vmaporjax.grad.Changed in version 0.4.0: With
topographic_map=Nonethe pairs are sampled by the uniform path ofAxonalProjection(binomial edge count, then distinct pairs), so the edges for a givenseeddiffer from 0.3. With a map, the random draws are the same as in 0.3.Examples
>>> import brainunit as u >>> import numpy as np >>> from braintools.conn import TopographicProjection >>> grid = np.stack(np.meshgrid(np.arange(6), np.arange(6)), -1).reshape(-1, 2) >>> positions = np.repeat(grid, 2, axis=0) * 40.0 * u.um # two neurons per site >>> topo = TopographicProjection( ... topographic_map=lambda a, b: 0.8 * float(np.hypot(*(a - b)) < 50.0), seed=0 ... ) >>> result = topo(pre_size=72, post_size=72, ... pre_positions=positions, post_positions=positions) >>> result.n_connections 443