API reference

Activity and experimental control

Signatures, parameters, return contracts, and source for activity and experimental control.

Overview

Threshold functions convert model-generated spike logits into events using fixed declared thresholds. Patch-phase layout helpers organize native cadence. HomeostaticThresholdController is an experimental optional code feature; it is not required by the lifecycle guides and is not a contribution presented in the technical report.

Source revision: caef7be03abd. Public export index.

StratifiedPatchPhaseLayout

axosim.activity.StratifiedPatchPhaseLayout(phase_ids: torch.Tensor, storage_permutation: torch.Tensor, inverse_permutation: torch.Tensor, phase_population_sizes: tuple[int, ...], storage_group_offsets: tuple[int, ...], storage_group_shape: tuple[int, int])

Source

Deterministic patch phases and a phase-major storage permutation.

Parameters

phase_ids torch.Tensor
required.
storage_permutation torch.Tensor
required.
inverse_permutation torch.Tensor
required.
phase_population_sizes tuple[int, ...]
required.
storage_group_offsets tuple[int, ...]
required.
storage_group_shape tuple[int, int]
required.

Attributes

Constructor fields are retained as read-only attributes.

Read-only attributes

StratifiedPatchPhaseLayout.patch_size: int
Native timesteps represented by one forecast block. Source
StratifiedPatchPhaseLayout.population_size: int
Number of persistent neurons. Source
StratifiedPatchPhaseLayout.phase_sizes: tuple[int, ...]
Source

FixedActivityThresholds

axosim.activity.FixedActivityThresholds(excitatory: tuple[float, ...], inhibitory: tuple[float, ...])

Source

Fixed spike-score thresholds stratified by role and morphology.

Parameters

excitatory tuple[float, ...]
required.
inhibitory tuple[float, ...]
required.

Attributes

Constructor fields are retained as read-only attributes.

Read-only attributes

FixedActivityThresholds.morphology_count: int
Source

Methods

FixedActivityThresholds.as_tensor

axosim.activity.FixedActivityThresholds.as_tensor(*, device: torch.device | str, dtype: torch.dtype) -> torch.Tensor

Source

Parameters

device torch.device | str
keyword-only, required. Execution or allocation device.
dtype torch.dtype
keyword-only, required. Floating-point execution or allocation dtype.

Returns

torch.Tensor

FixedBlockActivityThresholds

axosim.activity.FixedBlockActivityThresholds(forecast_steps: tuple[FixedActivityThresholds, ...])

Source

Fixed role/morphology thresholds for each forecast position.

Parameters

forecast_steps tuple[FixedActivityThresholds, ...]
required.

Attributes

Constructor fields are retained as read-only attributes.

Read-only attributes

FixedBlockActivityThresholds.forecast_step_count: int
Source
FixedBlockActivityThresholds.morphology_count: int
Source

Methods

FixedBlockActivityThresholds.as_tensor

axosim.activity.FixedBlockActivityThresholds.as_tensor(*, device: torch.device | str, dtype: torch.dtype) -> torch.Tensor

Source

Parameters

device torch.device | str
keyword-only, required. Execution or allocation device.
dtype torch.dtype
keyword-only, required. Floating-point execution or allocation dtype.

Returns

torch.Tensor

HomeostaticThresholdController

axosim.activity.HomeostaticThresholdController(*, group_ids: torch.Tensor, target_rates_hz: torch.Tensor, dt_ms: float, update_interval_ms: float, time_constant_ms: float, learning_rate: float, max_abs_offset: float)

Source

Adapt group thresholds to oppose sustained firing-rate errors.

Experimental optional feature. group_ids assigns neurons to declared groups; target_rates_hz supplies each group’s target. A causal group-rate estimate drives bounded threshold offsets. This interface does not establish biological timescales or biological realism.

Parameters

group_ids torch.Tensor
keyword-only, required. Integer population vector whose contiguous groups cover the target-rate vector.
target_rates_hz torch.Tensor
keyword-only, required. Positive finite firing-rate targets in hertz, one per declared group.
dt_ms float
keyword-only, required. Native simulation step in milliseconds.
update_interval_ms float
keyword-only, required. Interval between controller updates; an integer multiple of dt_ms.
time_constant_ms float
keyword-only, required. Time constant of the controller's smoothed rate estimate.
learning_rate float
keyword-only, required. Optimizer step size.
max_abs_offset float
keyword-only, required. Bound on the absolute threshold correction.

Methods

HomeostaticThresholdController.observe

axosim.activity.HomeostaticThresholdController.observe(activity: torch.Tensor) -> bool

Source

Observe one simulation step and update at the window boundary.

Observes one neuron activity vector for a simulation step; returns whether the update interval triggered an offset update. No future activity is used.

Parameters

activity torch.Tensor
required. Boolean neuron activity vector for one simulation step.

Returns

updated bool
True when the update interval triggers a threshold-offset update, otherwise False.

HomeostaticThresholdController.threshold_offsets_per_neuron

axosim.activity.HomeostaticThresholdController.threshold_offsets_per_neuron() -> torch.Tensor

Source

Return the current group offset for every population member.

Returns one current group-derived threshold offset per neuron.

Returns

offsets torch.Tensor
Current group-derived threshold offsets, one per population member.

build_stratified_patch_phase_layout

axosim.activity.build_stratified_patch_phase_layout(morphology_ids: torch.Tensor, inhibitory: torch.Tensor, *, patch_size: int, seed: int, tile_ids: torch.Tensor | None=None) -> StratifiedPatchPhaseLayout

Source

Balance phases independently inside every morphology and E/I group.

Parameters

morphology_ids torch.Tensor
required. Ordered morphology identity vocabulary.
inhibitory torch.Tensor
required.
patch_size int
keyword-only, required. Native timesteps represented by one block.
seed int
keyword-only, required. Random seed for the declared operation.
tile_ids torch.Tensor | None
keyword-only, default=None.

Returns

StratifiedPatchPhaseLayout

threshold_model_activity

axosim.activity.threshold_model_activity(spike_scores: torch.Tensor, morphology_ids: torch.Tensor, inhibitory: torch.Tensor, thresholds: FixedActivityThresholds) -> torch.Tensor

Source

Return variable-cardinality events from fixed model-score crossings.

Parameters

spike_scores torch.Tensor
required.
morphology_ids torch.Tensor
required. Ordered morphology identity vocabulary.
inhibitory torch.Tensor
required.
thresholds FixedActivityThresholds
required.

Returns

torch.Tensor

threshold_block_model_activity

axosim.activity.threshold_block_model_activity(spike_scores: torch.Tensor, morphology_ids: torch.Tensor, inhibitory: torch.Tensor, thresholds: FixedBlockActivityThresholds) -> torch.Tensor

Source

Threshold an ordered forecast block without fixing event counts.

Parameters

spike_scores torch.Tensor
required.
morphology_ids torch.Tensor
required. Ordered morphology identity vocabulary.
inhibitory torch.Tensor
required.
thresholds FixedBlockActivityThresholds
required.

Returns

torch.Tensor

Search guides, examples, and API signatures.