Agent skill
pytorch-training
Best practices for building robust PyTorch training loops. Use when generating or reviewing ML training code.
Install this agent skill to your Project
npx add-skill https://github.com/aiming-lab/AutoResearchClaw/tree/main/researchclaw/skills/builtin/tooling/pytorch-training
Metadata
Additional technical details for this skill
- author
- researchclaw
- version
- 1.0
- category
- tooling
- priority
- 3
- references
- PyTorch Performance Tuning Guide, pytorch.org
- code template
- import torch import torch.nn as nn from torch.utils.data import DataLoader # Reproducibility torch.manual_seed(seed) torch.cuda.manual_seed_all(seed) torch.backends.cudnn.deterministic = True # Training loop model.train() for epoch in range(num_epochs): for batch in train_loader: optimizer.zero_grad(set_to_none=True) loss = criterion(model(batch['input']), batch['target']) loss.backward() torch.nn.utils.clip_grad_norm_(model.parameters(), max_norm=1.0) optimizer.step() scheduler.step()
- trigger keywords
- training,pytorch,torch,deep learning,neural network,model
- applicable stages
- 10,12
SKILL.md
PyTorch Training Best Practice
- Use torch.manual_seed() for reproducibility (set for torch, numpy, random)
- Use DataLoader with num_workers>0 and pin_memory=True for GPU
- Enable cudnn.benchmark=True for fixed input sizes
- Use learning rate schedulers (CosineAnnealingLR or OneCycleLR)
- Implement early stopping based on validation metric
- Log metrics every epoch, save best model checkpoint
- Use torch.no_grad() for evaluation
- Clear gradients with optimizer.zero_grad(set_to_none=True) for efficiency
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
scientific-visualization
Publication-ready scientific figure design with matplotlib and seaborn. Use when creating journal submission figures with proper formatting, accessibility, and statistical annotations.
hypothesis-formulation
Structured scientific hypothesis generation from observations. Use when formulating testable hypotheses, competing explanations, or experimental predictions.
scientific-writing
Academic manuscript writing with IMRAD structure, citation formatting, and reporting guidelines. Use when drafting or revising research papers.
a-evolve
Apply A-Evolve's agentic evolution methodology to improve AI agent performance across runs. Use when the user wants to diagnose agent failures, generate targeted skills from error patterns, evolve system prompts, or accumulate episodic knowledge. Works standalone or inside AutoResearchClaw pipelines. Triggers on: "evolve", "self-improve", "diagnose failures", "generate skills from errors", "what went wrong and how to fix it", or any mention of A-Evolve.
chemistry-rdkit
Computational chemistry with RDKit for molecular analysis, descriptors, fingerprints, and substructure search. Use when working with SMILES, drug discovery, or cheminformatics tasks.
literature-search
Systematic literature review methodology including search strategy, screening, and synthesis. Use when conducting literature reviews or writing background sections.
Didn't find tool you were looking for?