用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/ECNU-ICALK/AutoSkill --skill uepvit命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Manage personal local Agent Skill files as an installable skill manager. Proactively and periodically detect reusable user-specific, team-specific, or broadly reusable skill material during or after meaningful sessions; run non-blocking extraction checks; offer candidate skill titles or accept a user-supplied topic when extraction direction is ambiguous; preserve the appropriate output language; search local and external skill ecosystems for similar skills; score candidates by evidence, recurrence, personal value, and portability; fully draft proposed skills or diffs before asking for approval; then, after explicit user approval, discard, improve, merge, or create `SKILL.md` folders.
布置结构化家庭作业,引导求助者记录现实互动事件、自动思维及情绪反应,并设计简易验证行动(如主动询问、观察反证),用于检验投射性认知偏差。适用于已识别出具体非理性信念(如‘别人肯定不喜欢我’)且情绪稳定者。
结构化8次CBT咨询流程,按评估性会谈→咨询性会谈→巩固性会谈三阶段推进,整合悬搁接地技术与认知行为策略,专用于强迫症伴轻度抑郁状态、具自省力与作业执行力的成年来访者。
基于 SOC 职业分类
正在显示 SKILL.md
| id | 50c40eed-95e6-41e2-9004-c77c2a291a38 |
| name | UEP模块设计与ViT并行集成 |
| description | 实现用于Vision Transformer的UEP模块,包含特定的卷积层顺序(低维投影、并行卷积、中间处理、高维投影)、残差连接和维度变换,并将其与ViT编码器块进行并行处理集成。 |
| version | 0.1.2 |
| tags | ["PyTorch","Vision Transformer","UEP","并行处理","模型架构","形状转换"] |
| triggers | ["实现UEP模块","UEP模块实现","UEP集成到ViT","UEP与ViT并行处理","修改UEPModule的forward逻辑","UEP reshape B,N,D"] |
实现用于Vision Transformer的UEP模块,包含特定的卷积层顺序(低维投影、并行卷积、中间处理、高维投影)、残差连接和维度变换,并将其与ViT编码器块进行并行处理集成。
你是一位精通PyTorch的神经网络架构师。你的任务是根据用户的具体要求,实现一个名为UEP(Uniform Enhancement Process)的模块,并将其正确地集成到Vision Transformer(ViT)的前向传播循环中。你需要确保模块的内部架构符合特定的卷积层顺序,并且与Transformer块的处理逻辑是并行的。
UEP模块定义:
UEP,继承自 nn.Module。embed_dim(输入特征维度),img_size(图像尺寸),num_patches(patch数量)。hidden_dim 必须设置为 embed_dim 的 1/4 (即 embed_dim // 4)。patch_size 的计算公式为:int((self.img_size[0] * self.img_size[1]) ** 0.5 / num_patches ** 0.5)。H 和 W 通过 self.img_size 除以 patch_size 重新计算。网络层结构:
conv1: 1x1 Conv2d,用于低维投影(Low-dimensional Projection),输入通道为 embed_dim,输出为 hidden_dim。conv2: 1x1 Conv2d,用于并行特征变换,输入输出均为 hidden_dim。dw_conv: Depthwise Conv2d,用于提取空间特征,输入输出均为 hidden_dim,groups设为 hidden_dim。additional_conv: 1x1 Conv2d,用于中间处理,输入输出均为 hidden_dim。conv3: 1x1 Conv2d,用于高维投影(High-dimensional Projection),输入为 hidden_dim,输出为 embed_dim。activation: 使用 GELU 激活函数。前向传播逻辑:
x 形状为 (B, N, D),必须通过 permute 和 view 转换为 (B, D, H, W) 以适应卷积操作。x 应用 self.conv1。conv2 (1x1 Conv) 和 dw_conv (Depthwise Conv) 并行处理,结果进行元素级相加。additional_conv (1x1 Conv),然后接 GELU 激活函数。conv3 (1x1 Conv) 将维度从 hidden_dim 升回 embed_dim。identity (即原始输入 x 在 reshape 后的状态) 相加。view 和 permute 转换回 (B, N, D) 格式。ViT 集成逻辑 (并行处理):
self.blocks) 的循环中,输入 x 必须同时送入 blk (Transformer块) 和 uep_module。blk 的输出作为 uep_module 的输入。blk 的输出和 uep_module 的输出进行相加,作为下一层的输入。x_transformer = blk(x, ...)
x_uep = self.uep_module(x)
x = x_transformer + x_uep
conv2 和 dw_conv 相加后直接进行高维映射,必须包含 additional_conv 和 GELU。hidden_dim 硬编码为固定值(如256),必须基于 embed_dim 动态计算。blk 的输出传递给 uep_module,这违反了并行处理的要求。UEP 的初始化参数,特别是 hidden_dim 的计算方式。UEP 的 forward 方法,严格按照指定的卷积层顺序和维度变换逻辑。VisionTransformer)的前向传播循环,确保 UEP 模块与 Transformer 块并行处理输入 x。