Neural Network Builder 技能:核对二维输入到三类输出的形状
EnglishClaude Code 安装步骤
- 从 GitHub 固定提交获取完整的 `plugins/ai-ml/neural-network-builder/skills/building-neural-networks` 目录。
- 复制到目标项目的 `.claude/skills/`,确认 `.claude/skills/building-neural-networks/SKILL.md`,再从项目根目录启动 Claude Code,输入 `/building-neural-networks`。
中文摘要
用 Claude Code 为简单分类设计网络层、损失和训练检查。先验证张量形状与标签,再运行小样本训练。
SKILL.md 中文导读
可复现示例
定义 2→8→3 的网络,对一个含 4 条记录的 batch 输出 logits。标签示例为 0、1、2、1。核对形状并运行一次训练步。工作步骤
- 写明输入宽度 2 和输出类别 3。对交叉熵传原始 logits 与整数类别索引。
- 先用四条样本跑前向和一次反向,查看 loss 是否有限。再在固定数据上执行小型训练。
验收方法
输出张量为 (4,3),损失有限,训练步可以计算并更新参数。
GitHub 原文 · 更新日期
适用环境
准备 Python、PyTorch 和自己生成的三类二维合成点。示例使用小型全连接网络。
常见问题
用 PyTorch CrossEntropyLoss 前要自行对输出做 softmax 吗?
按损失函数约定传入未归一化 logits。另在需要展示概率时再计算 softmax。
相关指南
相关推荐
groq-install-auth 技能
jeremylongshore/claude-code-plugins-plus-skills
anima-common-errors 技能
jeremylongshore/claude-code-plugins-plus-skills
apple-notes-hello-world 技能
jeremylongshore/claude-code-plugins-plus-skills
castai-hello-world 技能
jeremylongshore/claude-code-plugins-plus-skills
cohere-local-dev-loop 技能
jeremylongshore/claude-code-plugins-plus-skills
figma-security-basics 技能
jeremylongshore/claude-code-plugins-plus-skills