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])
Deterministic patch phases and a phase-major storage permutation.
Parameters
phase_idstorch.Tensor- required.
storage_permutationtorch.Tensor- required.
inverse_permutationtorch.Tensor- required.
phase_population_sizestuple[int, ...]- required.
storage_group_offsetstuple[int, ...]- required.
storage_group_shapetuple[int, int]- required.
Attributes
Constructor fields are retained as read-only attributes.
Read-only attributes
FixedActivityThresholds
axosim.activity.FixedActivityThresholds(excitatory: tuple[float, ...], inhibitory: tuple[float, ...])
Fixed spike-score thresholds stratified by role and morphology.
Parameters
excitatorytuple[float, ...]- required.
inhibitorytuple[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
Parameters
devicetorch.device | str- keyword-only, required. Execution or allocation device.
dtypetorch.dtype- keyword-only, required. Floating-point execution or allocation dtype.
Returns
torch.Tensor
FixedBlockActivityThresholds
axosim.activity.FixedBlockActivityThresholds(forecast_steps: tuple[FixedActivityThresholds, ...])
Fixed role/morphology thresholds for each forecast position.
Parameters
forecast_stepstuple[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
Parameters
devicetorch.device | str- keyword-only, required. Execution or allocation device.
dtypetorch.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)
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_idstorch.Tensor- keyword-only, required. Integer population vector whose contiguous groups cover the target-rate vector.
target_rates_hztorch.Tensor- keyword-only, required. Positive finite firing-rate targets in hertz, one per declared group.
dt_msfloat- keyword-only, required. Native simulation step in milliseconds.
update_interval_msfloat- keyword-only, required. Interval between controller updates; an integer multiple of dt_ms.
time_constant_msfloat- keyword-only, required. Time constant of the controller's smoothed rate estimate.
learning_ratefloat- keyword-only, required. Optimizer step size.
max_abs_offsetfloat- keyword-only, required. Bound on the absolute threshold correction.
Methods
HomeostaticThresholdController.observe()HomeostaticThresholdController.threshold_offsets_per_neuron()
HomeostaticThresholdController.observe
axosim.activity.HomeostaticThresholdController.observe(activity: torch.Tensor) -> bool
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
activitytorch.Tensor- required. Boolean neuron activity vector for one simulation step.
Returns
updatedbool- 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
Return the current group offset for every population member.
Returns one current group-derived threshold offset per neuron.
Returns
offsetstorch.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
Balance phases independently inside every morphology and E/I group.
Parameters
morphology_idstorch.Tensor- required. Ordered morphology identity vocabulary.
inhibitorytorch.Tensor- required.
patch_sizeint- keyword-only, required. Native timesteps represented by one block.
seedint- keyword-only, required. Random seed for the declared operation.
tile_idstorch.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
Return variable-cardinality events from fixed model-score crossings.
Parameters
spike_scorestorch.Tensor- required.
morphology_idstorch.Tensor- required. Ordered morphology identity vocabulary.
inhibitorytorch.Tensor- required.
thresholdsFixedActivityThresholds- 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
Threshold an ordered forecast block without fixing event counts.
Parameters
spike_scorestorch.Tensor- required.
morphology_idstorch.Tensor- required. Ordered morphology identity vocabulary.
inhibitorytorch.Tensor- required.
thresholdsFixedBlockActivityThresholds- required.
Returns
torch.Tensor