← Walkthrough

src/speech_decoding/models/v14_converged_v3/pack_r4.py

Selected training excerpt · lines 318–332 · source SHA-256 10e2eebf5adf

318    band_masks = (masks.slow_mask, masks.mid_mask, masks.hga_mask)  # each (B, N, T_b)319    B = masks.contact_mask.shape[0]320    device = grid.contact.device321322    contact_masked = masks.contact_mask[:, grid.contact, grid.band]  # (B, total)323324    temporal_masked = torch.zeros(B, grid.total, dtype=torch.bool, device=device)325    for b, bm in enumerate(band_masks):  # bm (B, N, T_b)326        sel = grid.band == b  # (total,) tokens of band b327        ct = grid.contact[sel]  # (n_b,) each token's contact328        pos = grid.bandpos[sel]  # (n_b,) band-token index329        temporal_masked[:, sel] = bm[:, ct, pos]  # (B, n_b) own-contact mask at (contact, pos)330331    masked = contact_masked | temporal_masked332    return masked, masked  # score EVERY masked token — no margin gate