training-optimization

training-optimization is a skill for Claude Code from mxslr/mlcraft. It costs 123 tokens per session (662 once invoked), scanned A, original, MIT.

A guide for training or fine-tuning deep-learning models, including transfer learning, where an existing trained model is adapted to a new task.

In plain words
What is it for?
Use it to plan fine-tuning, adjust learning rates and regularisation, choose data augmentation, and manage checkpoints, precision, and memory use.
Why use it?
It helps diagnose overfitting and underfitting and choose training settings based on the problem instead of guessing.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the mlcraft plugin — 23 skills, 1 command, 1 agent shipped together

Good fit Use it to plan fine-tuning, adjust learning rates and regularisation, choose data augmentation, and manage checkpoints, precision, and memory use.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mxslr/mlcraft/training-optimization
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 mxslr/mlcraft --skill training-optimization
Clone the repo
git clone --depth 1 https://github.com/mxslr/mlcraft

Made for: Claude Code.

Or install mlcraft, the plugin that ships this one along with the rest of its 23 skills, 1 command, 1 agent.

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 training-optimization

README.md
[![agentmods](https://agentmods.dev/badge/skills/mxslr/mlcraft/training-optimization/github.svg)](https://agentmods.dev/skills/mxslr/mlcraft/training-optimization)
Your own site
<a href="https://agentmods.dev/skills/mxslr/mlcraft/training-optimization"><img src="https://agentmods.dev/badge/skills/mxslr/mlcraft/training-optimization/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 training-optimization

Your own site · 80×15
<a href="https://agentmods.dev/skills/mxslr/mlcraft/training-optimization"><img src="https://agentmods.dev/badge/skills/mxslr/mlcraft/training-optimization.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 123 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 662 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.00123 $0.00662
Opus 5.5 $0.00049 $0.00265
Sonnet 5.5 $0.00025 $0.00132
Haiku 4.5 $0.00012 $0.00066

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

Security

Grade A, and why

training-optimization 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 1mo 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/training-optimization/SKILL.md · 33 lines

How it starts

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

Training & Fine-Tuning

Best-practice recipe for transfer-learning a strong model, and how to fix over/under-fitting.

Fine-tuning recipe (default that works)

  1. Transfer learning: start from ImageNet/pretrained weights; train from scratch only with lots of data.
  2. Two phases: (1) freeze backbone, train the new head; (2) unfreeze and fine-tune end-to-end at a lower LR.
  3. Discriminative / layer-wise LR: small LR for early backbone layers, higher for the head. Biggest single fine-tuning win.
  4. Schedule: cosine decay with a short warmup. Log the LR curve.
  5. Optimizer: AdamW (decoupled weight decay). Gradient clipping ~1.0.
  6. Selection: checkpoint the best epoch by the validation metric; early stopping.

Diagnose then regularize (don't guess)

  • Overfitting (train accuracy keeps rising while val loss rises or plateaus): raise weight decay, dropout, label smoothing; add MixUp; stronger-but-domain-appropriate augmentation; reduce epochs/patience; smaller/less-capacity head.
  • Underfitting (train acc low too): reduce regularization, raise LR / capacity / resolution, train longer, check data quality.
  • Match augmentation to the domain - do not use aggressive photometric/geometric ops that destroy the signal (e.g., harsh color/solarize on medical scans, or flips that change semantics).

Compute & memory (fit the budget)

  • Mixed precision (AMP) always on GPU.
  • Gradient checkpointing to fit high resolution / big models in limited VRAM (~3× memory saving, ~30% slower).
  • Small batch + gradient accumulation to keep an effective batch size when VRAM is tight; freeze BatchNorm stats at very small batch (LayerNorm backbones like ConvNeXt are safer there).
  • Preprocess once to disk if per-epoch CPU work (decode/enhance) starves the GPU - huge speedups.
  • Budget = seconds/epoch × epochs × models. Measure on a quick run first; pick resolution/epochs to fit the quota. Prefer one honest fit over a run that dies mid-way.

Read the full file on GitHub · 33 lines

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. 1mo ago First seen · 33 lines · 123 tokens per session scan A c76e88520c70

Subscribe to this mod's changes

training-optimization is a skill published in the GitHub repository mxslr/mlcraft (8 stars, last pushed 3mo ago), licensed MIT. It adds 123 tokens to every session and 662 once invoked, about $0.0005 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

Other skills, from other repositories

ml-for-aec

Computer vision for buildings, image-to-floorplan, generative ML models, performance prediction, structural analysis ML, energy prediction, natural language to design, and point cloud ML for AEC computational design.

Abhinavbwj/Claude-skills-for-Computational-Designers · 39 tokens

reinforcement-learning

Reinforcement Learning best practices for Python using modern libraries (Stable-Baselines3, RLlib, Gymnasium). Use when: Implementing RL algorithms (PPO, SAC, DQN, TD3, A2C) Creating custom Gymnasium environments Training, debugging, or evaluating RL agents Setting up hyperparameter tuning for RL Deploying RL models…

Aznatkoiny/zAI-Skills · 86 tokens

ml-for-aec

Computer vision for buildings, image-to-floorplan, generative ML models, performance prediction, structural analysis ML, energy prediction, natural language to design, and point cloud ML for AEC computational design.

marcinfinitesimal533/Claude-skills-for-Computational-Designers · 39 tokens

physicsnemo-discover

Official NVIDIA-authored guidance for navigating PhysicsNeMo — pick the model, datapipe, or example for a SciML/AI4Science task (surrogates, forecasting, downscaling, physics-informed, inverse, generative). Points at existing files via live repo search; never writes code. Do NOT use for installation or environment…

NVIDIA/physicsnemo · 124 tokens

torch-geometric

Graph Neural Networks (PyG). Node/graph classification, link prediction, GCN, GAT, GraphSAGE, heterogeneous graphs, molecular property prediction, for geometric deep learning.

synthetic-sciences/openscience · 41 tokens

esm

Comprehensive toolkit for protein language models including ESM3 (generative multimodal protein design across sequence, structure, and function) and ESM C (efficient protein embeddings and representations). Use this skill when working with protein sequences, structures, or function prediction; designing novel…

synthetic-sciences/openscience · 86 tokens