personal memory agent
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

tests/transcribe: assert wespeaker fbank front-end applies per-utt CMN

Adds the unit-test deliverable from req_repkefoe (CPO->VPE) covering the
fbank fix that shipped under req_2jjouhch / commit 810d274d. Feeds
non-zero-mean random audio through `_compute_wespeaker_features` and
asserts the returned feature matrix has zero mean per column (atol=1e-4
to absorb float32 residuals).

Vox1-O EER gate (<1.5%) was the existing functional verification of
this behavior; this test makes the CMN invariant explicit at the
unit level so any future regression of the front-end fails fast.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

+16
+16
tests/test_transcribe_embedder.py
··· 10 10 11 11 from observe.transcribe.main import ( 12 12 EMBEDDER_NAME, 13 + _compute_wespeaker_features, 13 14 _embed_statements, 14 15 _get_embedder_session, 15 16 _select_onnx_providers, ··· 40 41 assert result["embeddings"].dtype == np.float32 41 42 assert result["statement_ids"].tolist() == [1] 42 43 assert result["encoder"].item() == EMBEDDER_NAME 44 + 45 + 46 + def test_compute_wespeaker_features_applies_cmn() -> None: 47 + rng = np.random.default_rng(7) 48 + audio = (rng.normal(0.0, 0.01, 3 * 16000) + 0.05).astype(np.float32) 49 + 50 + feats = _compute_wespeaker_features(audio, 16000) 51 + 52 + assert feats.shape[0] > 0 53 + assert feats.shape[1] == 80 54 + np.testing.assert_allclose( 55 + feats.mean(axis=0), 56 + np.zeros(feats.shape[1], dtype=np.float32), 57 + atol=1e-4, 58 + ) 43 59 44 60 45 61 def test_embed_determinism() -> None: