计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
rail_representation_loss【效率与协作】Compute RAIL-KD layerwise and concatenated intermediate representation losses from pooled hidden states.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this skill when a distillation experiment must implement the RAIL-KD intermediate representation objective. It is appropriate after a teacher-layer mapping has selected exactly one teacher layer for each student layer. Do not use it for attention distribution matching, MiniLM relation losses, or layer-search logic.
[m][tokens][teacher_dim].[m][tokens][student_dim].layerwise for RAIL-KDl or concatenated for RAIL-KDc.Run:
python scripts/rail_loss.py --demo
python -m pytest tests
This skill uses small pure-Python numeric lists for portability. Production transformer code should pass actual tensors through equivalent pooling, projection, normalization, and distance operations while preserving the same contracts.