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]]
Load an upstream Branch-ELM checkpoint on the shared AxoBench contract.
Parameters
config_pathstr | Path- required. Architecture JSON used to reconstruct the upstream baseline.
checkpoint_pathstr | Path- required. Trusted model-weight file to reconstruct or evaluate.
devicestr- keyword-only, default='auto'. Execution or allocation device.
dtypestr | torch.dtype- keyword-only, default='float32'. Floating-point execution or allocation dtype.
Returns
predictCallable[[np.ndarray], np.ndarray]- Upstream Branch-ELM predictor on the shared AxoBench target-coordinate contract.
metadatadict[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]]
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
checkpointstr | Path- required. Upstream baseline checkpoint file.
devicestr- keyword-only, default='auto'. Execution or allocation device.
dtypestr | torch.dtype- keyword-only, default='float32'. Floating-point execution or allocation dtype.
streamingbool- keyword-only, default=False. Use the checkpoint's explicit streaming-state interface.
streaming_chunk_sizeint | None- keyword-only, default=None. Chunk size passed to a supported streaming backend.
Returns
predictCallable[[np.ndarray], np.ndarray]- Prediction function mapping native inputs (B,T,C) to spike logits and normalized soma targets (B,T,2).
metadatadict[str, Any]- Stored checkpoint metadata plus parameter counts, inference dtype, and streaming configuration.