PyTorch Image Classifier - Documentation¶
Complete documentation for the PyTorch Image Classification framework.
Quick Links¶
- Quick Start - Get training in 5 minutes
- Configuration Reference - All configuration options
- Training Guide - Complete training workflows
Documentation Structure¶
🚀 Getting Started¶
New to the framework? Start here:
- Installation - Setup and dependencies
- Data Preparation - Organize your dataset ⚠️ CRITICAL
- Quick Start - Train your first model
⚙️ Configuration¶
Complete configuration reference:
- Overview - Config system explained
- Reproducibility - Seed & determinism
- Data - Data loading parameters
- Training - Batch size, epochs, device
- Optimizer & Scheduler - Learning rate, momentum
- Models - All model architectures
- Transforms - Data preprocessing
- CLI Overrides - Command-line usage
- Examples - 10 complete configs
📖 User Guides¶
Practical workflows and how-tos:
- Training - Training workflows & trainer selection
- Advanced Training - Mixed precision, multi-GPU, DP
- Federated Learning - Distributed training with Flower (Optional)
- Inference - Running evaluation & inference strategies
- Test-Time Augmentation - TTA for improved accuracy
- Ensemble Inference - Combining multiple models
- Resuming Training - Continue interrupted runs
- Monitoring - TensorBoard & logging
- Hyperparameter Tuning - Systematic search
- Model Export - ONNX export & deployment
- Learning Rate Finder - Find optimal learning rate
🏗️ Architecture¶
Deep dive into the codebase:
- Overview - System architecture
- Entry Points - train.py & inference.py
- ML Source Modules - All ml_src components
- Data Flow - How data moves through system
- Design Decisions - Why it's built this way
🛠️ Development¶
Extend and customize:
- Adding Models - Custom architectures
- Adding Transforms - New augmentations
- Adding Optimizers - New optimization methods
- Adding Metrics - Custom evaluation metrics
- Extending Framework - General patterns
📚 Reference¶
Quick lookups and troubleshooting:
- Best Practices - Tips and conventions
- Troubleshooting - Common issues
- Performance Tuning - Speed & memory optimization
- FAQ - Frequently asked questions
Common Tasks¶
Train a Model¶
See: Training GuideResume Training¶
See: Resuming TrainingRun Inference¶
# Standard inference
ml-inference --checkpoint_path runs/hymenoptera_base_fold_0/weights/best.pt
# TTA for improved accuracy
ml-inference --checkpoint_path runs/hymenoptera_base_fold_0/weights/best.pt --tta
# Ensemble multiple models
ml-inference --ensemble \
runs/fold_0/weights/best.pt \
runs/fold_1/weights/best.pt \
runs/fold_2/weights/best.pt
Monitor Training¶
tensorboard --logdir runs/
# Or use ml-visualise
ml-visualise --mode launch --run_dir runs/hymenoptera_base_fold_0
Visualize Dataset¶
See: Monitoring GuideVisualize Predictions¶
See: Visualization ReferenceChange Model¶
See: Model ConfigurationDocumentation Navigation Tips¶
- New users: Start with Getting Started
- Quick reference: Check Configuration
- Workflows: See User Guides
- Understanding code: Read Architecture
- Customization: Explore Development
- Problems: Visit Troubleshooting
Key Concepts¶
Configuration System¶
YAML-based with CLI overrides:
Learn more →Data Organization¶
Mandatory structure:
data/your_dataset/
├── raw/ # All images organized by class
│ ├── class1/
│ ├── class2/
│ └── classN/
└── splits/ # Generated by ml-split
├── test.txt
├── fold_0_train.txt
├── fold_0_val.txt
└── ...
raw/, referenced by .txt index files.
Checkpointing¶
Two checkpoints per run:
- best.pt - Highest validation accuracy (for deployment)
- last.pt - Latest epoch (for resuming)
Run Organization¶
Automatic directory naming based on dataset, fold, and hyperparameters:
runs/
├── hymenoptera_base_fold_0/
├── hymenoptera_batch_32_lr_0.01_fold_0/
└── my_dataset_epochs_50_lr_0.001_fold_1/
Support¶
- Documentation: You're reading it!
- Examples: See Configuration Examples
- Troubleshooting: Check Troubleshooting Guide
- FAQ: See Frequently Asked Questions
Contributing to Documentation¶
Found an issue or want to improve the docs?
- Documentation source:
/docs/directory - Each section has its own folder
- Written in Markdown
- Feel free to submit improvements!
Happy training! 🚀
Start with the Quick Start Guide →