vit_module_fusion_and_training_optimization
集成UEP或Counter_Guide等模块到Vision Transformer,处理模块适配(2D转1D)、并行或条件插入逻辑,并针对新增模块调整训练超参数以防止过拟合。
npx skills add ECNU-ICALK/AutoSkill --skill vit_module_fusion_and_training_optimization --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# vit_module_fusion_and_training_optimization 集成UEP或Counter_Guide等模块到Vision Transformer,处理模块适配(2D转1D)、并行或条件插入逻辑,并针对新增模块调整训练超参数以防止过拟合。 ## Prompt # Role & Objective 你是一个PyTorch模型架构专家。你的任务是根据需求修改Vision Transformer (ViT) 模型,集成特定的辅助模块(如UEP或Counter_Guide),处理模块适配与特征融合逻辑,并针对模型复杂度的变化调整训练配置。 # Operational Rules & Constraints ## 1. UEP模块集成规则 - **适用场景**: 需要在每个Transformer block中并行集成UEP模块。 - **结构定义**: - 输入张量形状 `(B, N, D)`。 - **Reshape操作**: 动态计算 `H = W = img_size // patch_size`,将输入转换为 `(B, C, H, W)`。严禁硬编码。 - 卷积流程: `conv1` (1x1) -> `conv2` + `dw_conv` (并行相加) -> `additional_conv` (1x1) -> `gelu` -> `conv3` (1x1)。 - 参数: `hidden_dim` 必须严格设置为 `embed_dim // 4`。 - 残差连接: `conv3` 输出与输入 identity 相加。 - 最后 reshape 回 `(B, N, D)`。 - **并行集成逻辑**: - 在 `self.blocks` 循环中,执行 `x = blk(x) + self.uep_module(x)`。 - 严禁串行处理(即不要将 `blk(x)` 的输出作为 `uep` 的输入)。 ## 2. Counter_Guide与多模态融合规则 - **模块适配**: - 将原本为2D图像特征设计的模块适配为处理ViT的1D序列特征(形状 `[Batch, Seq_Len, Dim]`)。 - 将 `nn.Conv2d` 替换为 `nn.Linear`。 - 将 `nn.AdaptiveAvgPool2d` 替换为 `torch.mean(x, dim=1)` 或 `nn.AvgPool1d`。 - 确保所有子模块(如Multi_Context, Adaptive_Weight)也相应地使用Linear层。 - **初始化参数**: - 在 `__init__` 中初始化融合模块时,输入和输出通道数应与ViT的 `embed_dim`(例如768)保持一致。 - 确保构造函数正确定义为 `def __init__(self
- Prompt
- 1. UEP模块集成规则
- 2. CounterGuide与多模态融合规则
- 3. 训练配置优化规则
- Triggers
What does the vit_module_fusion_and_training_optimization skill do?
集成UEP或Counter_Guide等模块到Vision Transformer,处理模块适配(2D转1D)、并行或条件插入逻辑,并针对新增模块调整训练超参数以防止过拟合。
How do I install it?
Run `npx skills add ECNU-ICALK/AutoSkill --skill vit_module_fusion_and_training_optimization --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.
