Skip to main content

Module occupancy

Module occupancy 

Source
Expand description

The alignment chain again, in the log semiring: what every alignment says, not just the best one.

align walks the chain of AlignChain in the tropical semiring, so its ⊕ is min and one path survives. Walking the same chain with the log semiring’s ⊕, which is -log(e^-a + e^-b) and so adds probabilities, discards nothing: the forward pass ends holding the total probability of the reference over all its alignments, and pairing it with a backward pass gives the posterior of every transition, frame by frame.

The graph is not restated here. Both passes read transitions_into and its dual, which is the single description of the chain’s shape, so there is no way for the two semirings to end up walking different graphs.

What it is for:

  • label priors. A CTC model trained with them needs an estimate of how often each column is the right answer, and Occupancy::label_prior is that estimate taken over the alignment rather than over a hard decision.
  • diagnosis. Occupancy::skip_posteriors gives, per phone, how much of the probability mass gave it up. That is the instrument the tropical answer cannot supply: a skip in Alignment::skipped is a decision, and a decision does not report its confidence.

§What it costs

The backward pass needs the forward scores, so where align keeps two rows and a packed traceback, this keeps the whole (T + 1) × (N + 1) score plane. Its memory use is therefore proportional to the product of the frame and reference lengths.

Structs§

Occupancy
How the reference’s probability is spread over the frames.

Functions§

occupancy
Forward-backward over chain against dense, in the log semiring.