# Machine Learning Pro

> Expert Machine Learning development covering Deep Learning, PyTorch/TensorFlow, Model Fine-tuning, NLP, and Computer Vision. Use when this capability is needed.

- Skill: `tomevault-io/machine-learning-pro` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/machine-learning-pro`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/machine-learning-pro/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/machine-learning-pro

---


# Machine Learning Pro

Expert-level orchestration of advanced Machine Learning and Deep Learning models. Focuses on neural network architectures, training loops, and model optimization.

## Boundary

**`machine-learning-pro`** covers Deep Learning frameworks (PyTorch, TensorFlow, JAX), Model Architectures (Transformers, CNNs), Fine-tuning (LoRA, QLoRA), Natural Language Processing (NLP), and Computer Vision (CV). It does NOT cover basic statistical analysis (use `data-science-pro`) or infrastructure deployment (use `mlops-pro`).

## When to use

- Designing and training a custom neural network using PyTorch.
- Fine-tuning a pre-trained Large Language Model (LLM) on custom data.
- Implementing an image classification or object detection pipeline.
- Optimizing a deep learning model for inference speed (Quantization, Pruning).

## Workflow

1. **Data Preparation**: Build PyTorch `Dataset` and `DataLoader` classes for efficient batching.
2. **Model Design**: Define the neural network architecture (e.g., subclassing `nn.Module`).
3. **Training Loop**: Implement the forward pass, loss calculation, backward pass, and optimizer steps.
4. **Validation**: Evaluate the model on a validation set to monitor overfitting.
5. **Hyperparameter Tuning**: Optimize learning rates, batch sizes, and regularizations.
6. **Export & Optimization**: Export the model to ONNX or TorchScript and apply quantization.

### Operating principles

- **Overfit a Single Batch First**: Always verify that your model architecture can learn by overfitting a tiny subset of data before running a full training loop.
- **Transfer Learning**: Don't train from scratch if a pre-trained model (e.g., from Hugging Face) can be fine-tuned.
- **Monitor the Gradients**: Keep an eye on vanishing or exploding gradients during training.
- **Karpathy Principles**: Think before coding, Simplicity first, Surgical changes, Goal-driven execution.

## Suggested response format (STRICT)

Your response MUST follow this structure:

```xml
<Role>
Senior Machine Learning / AI Researcher.
</Role>

<Architecture>
[Neural Network Architecture or Fine-tuning Strategy]
</Architecture>

<Implementation>
[Deep Learning Artifact: PyTorch Model, Training Loop, or Hugging Face script]
</Implementation>

<Verification>
[Step-by-step verification plan: Loss tracking, Evaluation metrics]
</Verification>
```

## Resources in this skill

| Topic | Reference |
|-------|-----------|
| Machine Learning Roadmap | [roadmap.sh/machine-learning](https://roadmap.sh/machine-learning) |
| PyTorch Documentation | [pytorch.org/docs](https://pytorch.org/docs/stable/index.html) |
| Hugging Face Transformers | [huggingface.co/docs/transformers](https://huggingface.co/docs/transformers/index) |
| A Recipe for Training Neural Networks (Karpathy) | [karpathy.github.io/2019/04/25/recipe](http://karpathy.github.io/2019/04/25/recipe/) |

## Quick example

**Architecture:** A simple custom Multi-Layer Perceptron (MLP) in PyTorch.

```python
import torch
import torch.nn as nn
import torch.nn.functional as F

class SimpleMLP(nn.Module):
    def __init__(self, input_size, hidden_size, num_classes):
        super(SimpleMLP, self).__init__()
        self.fc1 = nn.Linear(input_size, hidden_size)
        self.fc2 = nn.Linear(hidden_size, num_classes)

    def forward(self, x):
        out = self.fc1(x)
        out = F.relu(out)
        out = self.fc2(out)
        return out
```

## Checklist before calling the skill done

- [ ] **Think Before Coding**: Network architecture and loss function selected appropriately.
- [ ] **Simplicity First**: Pre-trained models and standard architectures used over complex custom designs.
- [ ] **Surgical Changes**: Only modified relevant layers or training loop components.
- [ ] **Goal-Driven Execution**: Verified that training loss decreases and model converges.
- [ ] Data loaders are optimized (num_workers, pinning memory).
- [ ] GPU acceleration (CUDA/MPS) is correctly utilized.
- [ ] Model checkpoints are saved periodically.

---
> Source: [truongnat/skills](https://github.com/truongnat/skills) — distributed by [TomeVault](https://tomevault.io).
<!-- tomevault:4.0:skill_md:2026-05-22 -->

