pytorch-training

pytorch-training is a skill for Claude Code, Codex from congmnguyen/claude-code-wsl2-setup. It costs 118 tokens per session (570 once invoked), scanned A, original, MIT.

Conventions and debugging checks for building and training neural networks with PyTorch, a Python machine-learning framework.

In plain words
What is it for?
Use it when defining PyTorch models or training loops, including checks such as fitting one batch, verifying starting loss, and testing input-independent baselines.
Why use it?
It catches common training problems early, such as incorrect model wiring, bad labels, or a data pipeline that is not actually supplying useful inputs.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when defining PyTorch models or training loops, including checks such…

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/congmnguyen/claude-code-wsl2-setup/pytorch-training
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add congmnguyen/claude-code-wsl2-setup --skill pytorch-training
Clone the repo
git clone --depth 1 https://github.com/congmnguyen/claude-code-wsl2-setup

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pytorch-training

README.md
[![agentmods](https://agentmods.dev/badge/skills/congmnguyen/claude-code-wsl2-setup/pytorch-training.svg)](https://agentmods.dev/skills/congmnguyen/claude-code-wsl2-setup/pytorch-training)
Your own site
<a href="https://agentmods.dev/skills/congmnguyen/claude-code-wsl2-setup/pytorch-training"><img src="https://agentmods.dev/badge/skills/congmnguyen/claude-code-wsl2-setup/pytorch-training.svg" alt="Measured on agentmods" height="20"></a>
Per session 118 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 570 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00118 $0.00570
Opus 5 $0.00059 $0.00285
Sonnet 5 $0.00024 $0.00114
Haiku 4.5 $0.00012 $0.00057

Measured 7d ago against content hash 4805ea086906, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

pytorch-training scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/pytorch-training/SKILL.md · 22 lines

What it actually says

PyTorch Training

Model-building conventions

  • Set bias=False on any nn.Linear/nn.Conv2d immediately followed by BatchNorm — BN's mean-subtraction + learnable beta cancels the bias, making it dead params. Keep bias=True (default) on the output/classifier head, which has no BN after it.

Neural net training checklist (common mistakes if skipped)

Run through these before and during any training run — each one catches a class of silent bug that wastes full training runs:

  1. Overfit a single batch first. Before full training, verify the model can drive loss to ~0 on one small batch — if it can't, there's a bug in the model/loss/data pipeline; no point training on the full set.
  2. Verify loss @ init. Check the starting loss equals the theoretical value — softmax over n classes should give -log(1/n) (e.g. ~2.30 for 10 classes). A mismatch means a bad head init or mislabeled targets.
  3. Input-independent baseline. Train once with inputs zeroed out; the model must do worse than with real inputs. If they match, the data pipeline isn't actually feeding the model (it's only learning the prior).
  4. Init the output-layer bias to data statistics. Regression with mean 50 → init bias 50; class imbalance 1:10 → set logit bias so p≈0.1 at init. Kills the "hockey stick" loss curve where early steps just learn the bias.
  5. Visualize the exact tensor right before y_hat = model(x). Decode what actually enters the net — the only source of truth for catching preprocessing/augmentation bugs (e.g. forgetting to flip labels when flipping images).
  6. Don't trust LR-decay defaults; use a constant LR and tune it last. Borrowed code often decays by epoch number (e.g. ImageNet decays at epoch 30) — on a smaller dataset this silently drives the LR to ~0 before the model converges.
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 22 lines · 118 tokens per session scan A 4805ea086906

Subscribe to this mod's changes

pytorch-training is a skill published in the GitHub repository congmnguyen/claude-code-wsl2-setup (50 stars, last pushed 6d ago), licensed MIT. It adds 118 tokens to every session and 570 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.