components-metrics
Guides SpeechBrain model components, decoders, losses, metric statistics, WER scoring, checkpoints, Pretrainer, streaming helpers, and component-level troubleshooting.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- components-metrics
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Guides SpeechBrain model components, decoders, losses, metric statistics, WER scoring, checkpoints, Pretrainer, streaming helpers, and component-level troubleshooting.
- disable-model-invocation
- true
02 资源文件 6
- 参考文档references/checkpoints-and-pretraining.md2.8 KB
- 参考文档references/components-and-decoders.md2.6 KB
- 参考文档references/metrics-and-scoring.md2.4 KB
- 参考文档references/streaming.md2.5 KB
- 参考文档references/troubleshooting.md2.0 KB
- 脚本scripts/compute_wer_cli.py2.9 KB
03 SKILL.md 正文
SpeechBrain components and metrics
Use this sub-skill when the task is to choose, wire, debug, or test SpeechBrain neural components, decoders, metrics, checkpoints, pretrained-weight loading, streaming helpers, or scoring utilities.
Route map
| Task | Read/run |
|---|---|
| Select neural modules, lobes, feature wrappers, decoders, or losses. | references/components-and-decoders.md |
| Save/recover checkpoints or load pretrained weights into modules. | references/checkpoints-and-pretraining.md |
| Compute WER/PER/CER, metric stats, classification/binary metrics, or scoring summaries. | references/metrics-and-scoring.md; run scripts/compute_wer_cli.py. |
| Work on streaming/chunked ASR or streaming feature wrappers. | references/streaming.md |
| Diagnose shape, checkpoint, metric, decoder, or streaming failures. | references/troubleshooting.md |
Common component workflow
- Keep model/module construction in HyperPyYAML when possible.
- Use recipe
Brainhooks to wire forward/objective/metric behavior. - Validate tensor shapes and relative lengths before decoder or metric calls.
- Use
Checkpointerfor local experiment state andPretrainerfor fetching/loading pretrained model files. - Use metric stats classes inside
on_stage_start/compute_objectives/on_stage_endpatterns.
Useful bundled script
python scripts/compute_wer_cli.py ref.txt hyp.txt --mode strict
The script is adapted from SpeechBrain's WER utility pattern and uses the installed package only.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).