basics · latent projection lab · l2 geometry · cosine matrix · 10 s repeatpad

Shared 512-d Audio-Text Projection & RepeatPad Lab

CLAP projects 48 kHz audio (HTSAT-large) and text captions (RoBERTa) onto unit-norm vectors in a shared 512-d hypersphere, tiles clips shorter than 10 s via repeatpad, and scales cosines by logit_scale before softmax. Measure all three mechanics live.

Model Status (207.05 MB q8 WASM)

1 · Cross-Modal Audio × Caption Cosine Matrix & L2 Norms

Runs live forward passes across 6 distinct environmental, speech, and animal clips against 6 captions to inspect raw 512-d unit-sphere cosine similarity and verify L2 normalization of both audio_embeds and text_embeds.

2 · Windowing / 10-Second RepeatPad & Temperature Softmax

Drop, paste, or choose any audio file to test 1 s vs 3 s vs 7 s vs full repeatpad framing.
Click to record audio for windowing & temperature probes.
Loading sample… 48,000 Hz mono

RepeatPad Crop Sensitivity (1 s vs 3 s vs 7 s vs Full)

RepeatPad crop sensitivity metrics
Crop Repeats → 10 s Top-1 Label Cosine Prob Latency
Run the RepeatPad sweep above to inspect window framing.

Temperature Softmax vs Raw Cosine (Full Clip)

Drag temperature T to rescale the live CLAP logits without re-running ONNX.

    Show the Code (Temperature Softmax & RepeatPad Diagnostics)

    Show the code: Numerically stable temperature softmax (clap-general-core.mjs)
    Show the code: 10-second repeatpad framing geometry inspector (clap-general-core.mjs)