Views
No views yet
omura_clap_head.pt, ~1 MB —
a single residual linear layer). It is not a re-upload of CLAP's weights, and
the base CLAP model is unmodified.laion/larger_clap_general checkpoint.Linear(512, 512) residual adapter (out = normalize(x + W x)) applied to
CLAP's frozen audio embeddings, trained with a cross-entropy contrastive objective
against CLAP's frozen text-class embeddings.| Accuracy | |
|---|---|
| CLAP zero-shot (no adapter) | 85.25% |
| + omura-embed-audio adapter | 95.75% |
benchmarks/eval/clap/finetune_esc50_head.py in the
omura-backend repo; see also
BENCHMARK_REPRODUCTION.md there.1import torch, torch.nn.functional as F
2from transformers import ClapModel, ClapProcessor
3
4base = ClapModel.from_pretrained("laion/larger_clap_general")
5processor = ClapProcessor.from_pretrained("laion/larger_clap_general")
6
7ckpt = torch.load("omura_clap_head.pt", map_location="cpu")
8head_w = ckpt["state_dict"] # {"proj.weight": ..., "proj.bias": ...}
9
10def apply_head(x, w, b):
11 return F.normalize(x + x @ w.T + b, dim=-1)
12
13# audio_emb = base.get_audio_features(**inputs) # frozen CLAP embedding
14# adapted = apply_head(audio_emb, head_w["proj.weight"], head_w["proj.bias"])