pytorch-train

pytorch-train is a skill for Claude Code from Axect/pytorch_template. It costs 161 tokens per session (5,495 once invoked), scanned A, original, MIT.

A configuration-based workflow for training machine-learning models built with PyTorch, a popular Python framework for deep learning.

In plain words
What is it for?
Creating experiment files, running hyperparameter optimization with Optuna, selecting the best settings, and running final regression or classification training.
Why use it?
It organizes model training into repeatable configuration and experiment steps, reducing manual setup and making it easier to compare settings.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Creating experiment files, running hyperparameter optimization with Optuna, selecting the best settings, and running final regression or classification training.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/axect/pytorch_template/pytorch-train
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 Axect/pytorch_template --skill pytorch-train
Clone the repo
git clone --depth 1 https://github.com/Axect/pytorch_template

Made for: Claude Code.

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-train

README.md
[![agentmods](https://agentmods.dev/badge/skills/axect/pytorch_template/pytorch-train/github.svg)](https://agentmods.dev/skills/axect/pytorch_template/pytorch-train)
Your own site
<a href="https://agentmods.dev/skills/axect/pytorch_template/pytorch-train"><img src="https://agentmods.dev/badge/skills/axect/pytorch_template/pytorch-train/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for pytorch-train

Your own site · 80×15
<a href="https://agentmods.dev/skills/axect/pytorch_template/pytorch-train"><img src="https://agentmods.dev/badge/skills/axect/pytorch_template/pytorch-train.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 161 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,495 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.00161 $0.05495
Opus 5.5 $0.00064 $0.02198
Sonnet 5.5 $0.00032 $0.01099
Haiku 4.5 $0.00016 $0.00549

Measured 4d ago against content hash deacda257bd9, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

pytorch-train 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 4d 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-train/SKILL.md · 351 lines

How it starts

The opening of the file, as written. The whole thing — 351 lines — stays where its author put it; the contents beside it link to each section on GitHub.

pytorch-train

Train models through this template's full pipeline: config creation, HPO, fresh-seed finalization, best-param extraction, final training, and held-out test evaluation.

Usage

/pytorch-train [phase] [options]

Phases (auto-detected from user intent if omitted):

  • full — Complete pipeline (Phases 1-5)
  • config — Create config files only (Phases 1-2)
  • hpo — Run HPO (Phase 3, assumes configs exist)
  • extract — Check HPO results, re-train the top trials on fresh seeds (hpo-finalize), and write best.yaml (Phase 4)
  • train — Run final training with best.yaml and evaluate it on the test split (Phase 5)

Phase 1: Gather Requirements

Before creating any files, confirm these with the user:

Item Example Notes
Project name SolarFlux, WavePredict Used in project: field and directory names
Version v0.3, v1.32 Determines config subdirectory
Model name fluxnet, wavenet, mlp File prefix and net: path
Task type regression / classification Determines criterion, metric direction
Model module path model.MLP, recipes.regression.model.MLP Importlib path for net: field
net_config {nodes: 64, layers: 4} Architecture hyperparameters
Data loader existing load_data() or needs new one Must return (train, val, test); recipe scaffolding if needed
Device cuda:0 (default if available) GPU index

Task Type Defaults

Setting Regression Classification
criterion torch.nn.MSELoss torch.nn.CrossEntropyLoss
criterion_config {} {}
metric (HPO) val_loss (or val_r2 with direction: maximize) val_loss (or val_accuracy with direction: maximize)
direction (HPO) minimize minimize
metrics (logged val metrics) [mae, r2] [accuracy]

Pre-flight Check (Before HPO)

After creating configs, always run preflight before HPO:

Read the full file on GitHub · 351 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 4d ago Changed · +51 lines · +34 tokens per session deacda257bd9
  2. 3mo ago First seen · 300 lines · 127 tokens per session scan A 2028f2104e07

Subscribe to this mod's changes

pytorch-train is a skill published in the GitHub repository Axect/pytorch_template (10 stars, last pushed 4d ago), licensed MIT. It adds 161 tokens to every session and 5,495 once invoked, about $0.0006 per session on Opus 5.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-31.

Related

pytorch-train compared with skills from other repositories

pytorch-train next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
pytorch-trainAxect/pytorch_templateSkill104d agoMITA161Claude Code
perforatedaiPerforatedAI/PerforatedAISkill24111d agoApache-2.0A133Claude Code, Codex
marimo-pairmarimo-team/marimoSkill24ktodayApache-2.0A57Claude Code, Codex
data-science-python-stackprobabl-ai/skillsSkill1401mo agoBSD-3-ClauseA22Claude Code
daskLord1Egypt/scientific-agent-toolkitSkill36mo agoMITA69Claude Code, Codex
torch-geometricLord1Egypt/scientific-agent-toolkitSkill36mo agoMITA129Claude Code, Codex
pytorch-patternsaffaan-m/ECCSkill315kyesterdayMITA32Claude Code, Kiro