API reference

AxoBench prediction adapters

Signatures, parameters, return contracts, and source for axobench prediction adapters.

Overview

Prediction adapters reconstruct checkpoint models, select morphology identities, and return NumPy arrays in AxoBench’s expected coordinates. The current AxoBench package is an additional dependency for the CLI evaluator. The source supports native and streaming predictor options in Python; the CLI exposes its declared subset.

Source revision: caef7be03abd. Public export index.

make_official_elm_predictor

axosim.axobench_iteration.make_official_elm_predictor(config_path: str | Path, checkpoint_path: str | Path, *, device: str='auto', dtype: str | torch.dtype='float32') -> tuple[Callable[[np.ndarray], np.ndarray], dict[str, Any]]

Source

Load an upstream Branch-ELM checkpoint on the shared AxoBench contract.

Parameters

config_path str | Path
required. Architecture JSON used to reconstruct the upstream baseline.
checkpoint_path str | Path
required. Trusted model-weight file to reconstruct or evaluate.
device str
keyword-only, default='auto'. Execution or allocation device.
dtype str | torch.dtype
keyword-only, default='float32'. Floating-point execution or allocation dtype.

Returns

predict Callable[[np.ndarray], np.ndarray]
Upstream Branch-ELM predictor on the shared AxoBench target-coordinate contract.
metadata dict[str, Any]
Configuration, checkpoint identity, parameter counts, dtype, and output conventions.

make_checkpoint_predictor

axosim.axobench_iteration.make_checkpoint_predictor(checkpoint: str | Path, *, device: str='auto', dtype: str | torch.dtype='float32', streaming: bool=False, streaming_chunk_size: int | None=None) -> tuple[Callable[[np.ndarray], np.ndarray], dict[str, Any]]

Source

Load a standard AxoSim checkpoint as an AxoBench prediction callable.

Returns (predictor,metadata). The predictor accepts native NumPy inputs (B,T,C), optionally with morphology IDs when supported, and returns floating-point NumPy (B,T,2) outputs in AxoBench coordinates. Streaming requires the checkpoint’s streaming API. Metadata includes resident parameter count and inference dtype.

Parameters

checkpoint str | Path
required. Upstream baseline checkpoint file.
device str
keyword-only, default='auto'. Execution or allocation device.
dtype str | torch.dtype
keyword-only, default='float32'. Floating-point execution or allocation dtype.
streaming bool
keyword-only, default=False. Use the checkpoint's explicit streaming-state interface.
streaming_chunk_size int | None
keyword-only, default=None. Chunk size passed to a supported streaming backend.

Returns

predict Callable[[np.ndarray], np.ndarray]
Prediction function mapping native inputs (B,T,C) to spike logits and normalized soma targets (B,T,2).
metadata dict[str, Any]
Stored checkpoint metadata plus parameter counts, inference dtype, and streaming configuration.

Search guides, examples, and API signatures.