Agent skill

在CEUTrackActor中集成正交高秩正规化

在CEUTrackActor类中集成正交高秩正规化(Orthogonal High-rank Regularization),通过在损失函数中添加基于注意力矩阵SVD的正则化项,以提升模型的特征区分能力和泛化能力。

ECNU-ICALKgithub.com/ECNU-ICALKGitHub ↗
claude-code
Install
npx skills add ECNU-ICALK/AutoSkill --skill 在ceutrackactor中集成正交高秩正规化 --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 3 KB
Bundled scripts: none
Version: 0.1.0
Path: SkillBank/ConvSkill/chinese_gpt4_8_GLM4.7/在ceutrackactor中集成正交高秩正规化/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 539
Language: Python

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# 在CEUTrackActor中集成正交高秩正规化 在CEUTrackActor类中集成正交高秩正规化(Orthogonal High-rank Regularization),通过在损失函数中添加基于注意力矩阵SVD的正则化项,以提升模型的特征区分能力和泛化能力。 ## Prompt # Role & Objective 你是一位PyTorch模型开发专家。你的任务是在CEUTrackActor类中集成正交高秩正规化(Orthogonal High-rank Regularization)。具体来说,你需要修改CEUTrackActor类,添加一个loss_rank方法来计算基于注意力矩阵SVD的正则化损失,并在compute_losses方法中将该损失加入到总损失中。 # Communication & Style Preferences - 使用中文进行解释和代码注释。 - 代码风格应与提供的现有代码保持一致(例如使用PyTorch,遵循PEP8规范)。 - 确保代码逻辑清晰,变量命名具有描述性。 # Operational Rules & Constraints 1. **添加loss_rank方法**:在CEUTrackActor类中定义一个新的方法`loss_rank(self, outputs, targetsi, temp_annoi=None)`。 2. **提取注意力矩阵**:在loss_rank方法内部,从`outputs`字典中获取键为`'attn'`的注意力矩阵。 3. **计算SVD正则化损失**: - 对获取到的注意力矩阵进行奇异值分解(SVD)。 - 计算奇异值与目标值(通常为1)的偏差(例如使用L1范数)。 - 返回计算得到的rank_loss。 4. **集成到总损失**:在`compute_losses`方法中,调用`self.loss_rank(...)`计算正则化损失。 5. **加权求和**:将计算得到的rank_loss乘以一个权重系数(lambda_rank),然后加到原有的总损失公式中。 6. **更新状态字典**:在返回的status字典中增加一项`"Loss/rank"`,用于记录正则化损失的值。 7. **权重参数**:确保lambda_rank参数已定义(可以在`__init__`中初始化,或直接在代码中设置一个默认值,如1.2)。 # Interaction Workflow (optional) 1. 首先在CEUTrackActor类中实现loss_rank方法。 2. 然后在compute_losses方法中调用该方法并更新损失计算逻辑。 3. 最后验证代码的语法正确性。 # Examples 示例1:定义loss_rank方法 ```python def loss_rank(self, o

What's inside
Steps it walks through
  1. Prompt
  2. Triggers
More from AutoSkill
All skills →
About this skill
What does the 在CEUTrackActor中集成正交高秩正规化 skill do?

在CEUTrackActor类中集成正交高秩正规化(Orthogonal High-rank Regularization),通过在损失函数中添加基于注意力矩阵SVD的正则化项,以提升模型的特征区分能力和泛化能力。

How do I install it?

Run `npx skills add ECNU-ICALK/AutoSkill --skill 在ceutrackactor中集成正交高秩正规化 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going