Set up experiment tracking for a machine learning training run
Step-by-step setup to log metrics, hyperparameters, and artifacts from your training script, locally or on a cluster.
The prompt
Help me set up experiment tracking for my machine learning training.
Tracking tool: [e.g. "Weights & Biases", "MLflow", "TensorBoard", "not chosen yet"]
Framework: [e.g. "PyTorch", "PyTorch Lightning", "Hugging Face Trainer", "Keras"]
Where training runs: [laptop / single cloud VM / Kubernetes pod / Slurm cluster]
My training script: [paste the key parts: config, training loop, evaluation, checkpoint saving]
What I want to compare across runs: [e.g. "learning rate and batch size vs. validation loss"]
Give me:
1. If I haven't chosen a tool, a short comparison for my setup and a recommendation.
2. The code changes to my script: initializing a run, logging the full config/hyperparameters, logging metrics per step and per epoch, logging the git commit and dataset version, and saving checkpoints as artifacts.
3. How to pass credentials safely in my environment (environment variables or secrets objects, never hard-coded in code or container images). Do not ask me to paste API keys.
4. If I run on Kubernetes or a cluster: the job or pod spec changes, how logs reach the tracker, and how to handle preemption and resumed runs without creating duplicate runs.
5. A naming and tagging convention for runs so I can find and compare them later.
6. A quick test: a 2-minute dry run that confirms logging works before a long job.
7. Common mistakes: logging too often, missing random seeds, forgetting to log the evaluation split, and tracking runs that crashed.
Keep code minimal and explain each change in one line.
Highlighted [brackets] are blanks to replace with your own details.
Fill in the blanks and use this promptMore Software Development prompts
What to fill in
- laptop / single cloud VM / Kubernetes pod / Slurm cluster
- e.g. "learning rate and batch size vs. validation loss"
How this prompt is built
This prompt follows the Few-Shot structure (Few-shot prompting). A few-shot prompt includes one or more worked examples of the input and the output you want, so the model can copy the pattern instead of guessing it.
Related prompts
- Break my first coding project into small buildable stepsA milestone plan where every step leaves you with a working program and tells you what to learn next.
- Diagnose slow launches and API cold starts in my mobile appA codebase-specific diagnosis of startup time, serverless cold starts, and network waste, with fixes ranked by impact on perceived speed.
- Diagnose and fix a flaky testWorks out why a test passes and fails intermittently, how to reproduce it, and how to fix the cause rather than adding retries.
- Design consistent API error responses developers can act onTurns unhelpful API errors into a consistent format with clear codes, statuses, and messages that tell callers exactly what to fix.