Skip to main content

Module head

Module head 

Source
Expand description

Speech CTC encoder head (P64, fail-closed) — AU-LEARNED.

SpeechHead performs greedy CTC decoding over learned weights loaded through the common fail-closed loader. It abstains (BackendUnavailable) when (a) no weights are present, or (b) the loaded model declares an unknown language (language_slot == 0). There is no silent fallback map: without a real model the head produces no tokens rather than inventing a transcription.

Blob convention: dims = [vocab, feat_dim, language_slot]. Token index 0 is the CTC blank. data is a row-major projection of vocab * feat_dim weights followed by vocab biases. Per log-mel frame the head computes logit_v = bias_v + Σ_f proj[v,f] * logmel[f], takes the argmax token, then applies the standard CTC collapse (drop repeats, then drop blanks). Decoding is the hot path and allocates nothing — collapse state is a single previous-index register, and tokens are written straight into the caller’s buffer.

Structs§

SpeechHead
Learned speech CTC head. Fail-closed: Absent state or unknown language ⇒ abstain.