Skip to main content

alignment.UnitModel

alignment.UnitModel(bundle, z_scaled, pids, axial_um)

The released unit-level model over the prepared unit dataset (offline runs only).

z_scaled are the standardised 60-d latents of every prepared unit, pids their insertion and axial_um their physical axial position on the probe (µm from the tip) from the spike sorter – never the human alignment. All three come from the same prepared unit arrays (:func:ephysatlas.unit_level_encoder.prepare_unit_data), so their order agrees.

Methods

Name Description
load Load the release and its prepared unit data (prepared from IBL S3 when missing).
log_mixture_weights [N, S] log sub-type weights gamma_k(x) gamma_j|k(x) at raw contexts.
units_of (z_scaled [n, 60], axial_um [n]) of the units recorded on pid.

load

alignment.UnitModel.load(
    repo_id=UNIT_MODEL_REPO_ID,
    revision=UNIT_MODEL_REVISION,
    device=None,
    prepared_data_dir=None,
)

Load the release and its prepared unit data (prepared from IBL S3 when missing).

The prepared data hold each unit’s sorter-local axial position (unit_axial_um.npy, written with the other unit arrays); data prepared before it existed are re-prepared.

log_mixture_weights

alignment.UnitModel.log_mixture_weights(context_raw)

[N, S] log sub-type weights gamma_k(x) gamma_j|k(x) at raw contexts.

units_of

alignment.UnitModel.units_of(pid)

(z_scaled [n, 60], axial_um [n]) of the units recorded on pid.