function

states.kalman.project.mahalanobis_d2

def mahalanobis_d2(cs_field: torch.Tensor, cs_cov: torch.Tensor, ds_field: torch.Tensor, label: str) -> torch.Tensor

Pairwise Mahalanobis chi-squared over a measurement subspace.

Truncates the state to ``ds_field``'s dimension (``H = [I, 0]``), then solves :math:`\Sigma x = (a - b)` per pair and returns :math:`(a - b)^T x`. Shared by :class:`Mahalanobis`, :class:`~unitrack.gates.MotionGate`, and :class:`~unitrack.gates.SoftMotionGate` so they agree on the projection and PSD-guard conventions.

Parameters

NameTypeDescription
cs_fieldtorch.Tensor``(N, D)`` tracklet mean.
cs_covtorch.Tensor``(N, D, D)`` tracklet covariance.
ds_fieldtorch.Tensor``(M, d_meas)`` detection field.
labelstrIdentifier embedded in :func:`solve_psd`'s error message.

Returns

torch.Tensor — ``(N, M)`` pairwise chi-squared distances.

Source: unitrack/states/kalman/project.py:98