states.SoftReplace
class SoftReplace:Differentiable :class:`~unitrack.states.Replace` driven by a transport plan.
Each tracklet's field becomes ``sum_j p[i, j] * detection.field[j]``,
where ``p`` is an ``(N, M)`` row-stochastic transport plan. For
``p[i] = e_j`` (one-hot) this reduces to the hard :class:`~unitrack.states.Replace`.
``soft_assignment`` may be supplied at construction when the caller
has already computed the plan; otherwise the plan is read at call
time from ``match.soft_plan`` (attribute on :class:`~unitrack.data.MatchOutcome`),
which :class:`~unitrack.assignment.Associate` attaches automatically
when its assignment backend is a
:class:`~unitrack.assignment.SoftAssignment`.
Rows of the transport plan that sum to zero (every pair forbidden by
an upstream gate) preserve the prior tracklet field rather than
overwriting it with the all-zero blend that ``plan @ v`` would
produce — that would silently destroy re-id embeddings for
fully-gated tracklets.
Parameters
| Name | Type | Description |
|---|---|---|
| field | str | Tracklet field to blend. |
| soft_assignment = None | torch.Tensor | Precomputed ``(N, M)`` transport plan. If ``None``, the plan is read from ``match.soft_plan`` at call time. |
Members
property
Source: unitrack/states/soft.py:14