Skip to content
Back to skills

Training Workflows

ASecurity

"Compose timm API-level training loops with optimizer and scheduler

  • 247 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 9, 2026
devopspythonbashdebuggingapi

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned September 9, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill training-workflows --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Training Workflows?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Training Workflows
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-training-workflows-26aca393/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-training-workflows-26aca393)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: training-workflows
description: "Compose timm API-level training loops with optimizer and scheduler
  factories, loss selection, task wrappers, EMA, AMP scaling, metrics,
  checkpoint state, and safe CPU smoke checks. Use when writing or debugging
  custom training code rather than cataloging train.py CLI flags or building
  data loaders."
disable-model-invocation: true
metadata:
  disco-role: operating
license: Apache 2.0
---

# Training Workflows

Use this sub-skill when an agent needs to assemble or debug timm training components in Python code: `create_optimizer_v2`, `optimizer_kwargs`, `create_scheduler_v2`, loss modules, task wrappers, EMA, AMP scaling, metrics, and checkpoint-saving concepts.

## Route by Need

- **Optimizer or parameter groups**: Start with `references/optimizer-scheduler-guide.md` for `create_optimizer_v2`, weight-decay filtering, layer decay, hybrid fallback groups, and `optimizer_kwargs` config translation.
- **LR schedule behavior**: Use `references/optimizer-scheduler-guide.md` for `create_scheduler_v2`, epoch-vs-update stepping, warmup, cycles, plateau metrics, and returned adjusted epoch counts.
- **Losses and task wrappers**: Use `references/training-api.md` for `LabelSmoothingCrossEntropy`, `SoftTargetCrossEntropy`, `BinaryCrossEntropy`, `JsdCrossEntropy`, `ClassificationTask`, and distillation task routing.
- **EMA, AMP, metrics, checkpoints**: Use `references/training-api.md` for `ModelEma` variants, `NativeScaler`, `accuracy`, `AverageMeter`, task checkpoint state, and `CheckpointSaver` concepts.
- **Failure diagnosis**: Use `references/troubleshooting.md` for unsupported optimizer names, layer-decay grouping, scheduler step confusion, mixup/BCE target shape, distillation shape mismatches, EMA resume, and AMP/device mismatch.
- **Smoke construction**: Run or adapt `scripts/training_api_smoke.py` to verify a model, optimizer, scheduler, loss, optional task wrapper, metrics, EMA, and one CPU backward pass.

## Boundaries

- This sub-skill covers API-level composition. Leave train script flag catalogs and launch recipes to `cli-workflows`.
- This sub-skill assumes tensors already come from a valid pipeline. Leave dataset, loader, transforms, mixup/cutmix construction, and collation details to `data-pipelines`.
- Do not make generated examples depend on repository-local files; keep examples importable from installed `timm` and standard PyTorch.

## Safe Defaults

For a minimal custom loop, prefer `create_model(..., pretrained=False)`, `create_optimizer_v2(model, opt='adamw', lr=...)`, `create_scheduler_v2(optimizer, sched='cosine', num_epochs=..., warmup_epochs=...)`, a target-compatible loss, `accuracy`/`AverageMeter` for logging, and optional `ModelEmaV3` after model/device placement.

Run the smoke script before recommending a larger recipe:

```bash
python scripts/training_api_smoke.py --model resnet18 --opt adamw --sched cosine
```

Files in this skill

  • SKILL.md2.9 KB
  • references/optimizer-scheduler-guide.md7.2 KB
  • references/training-api.md7.2 KB
  • references/troubleshooting.md6.1 KB
  • scripts/training_api_smoke.py5.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.