PyTorch Template
The PyTorch template scaffolds a production-ready ML project with PyTorch, torchvision, and common ML dependencies. Two variants are available:pytorch: basic inference template for deploymentpytorch-train: complete training pipeline with checkpoints, validation, and metrics
Quick Start
cirron init.
Project Structure
Dockerfile, .gitignore, README.md, .env.example, tests), see Common files.
Cirron-specific bits
cirron.yaml
The generated config wires the training entrypoint and runtime:Profiling hooks
The generatedtrain.py and inference.py integrate with the Cirron SDK. Call ci.profile() once at module top so traces show up in cirron traces:
ci.scope as a context manager:
requirements.txt
Model Types
- Classification:
nn.CrossEntropyLoss, softmax output. Default architecture is a small CNN. - Regression:
nn.MSELoss, linear output. Default architecture is a fully-connected MLP.
cirron init prompt selects which one is generated into src/model.py.
Usage
GPU Support
The generated code automatically detects CUDA viatorch.cuda.is_available() and falls back to CPU. To target a GPU build, set runtime: gpu in cirron.yaml.
Next Steps
TensorFlow Template
Alternative deep learning framework
scikit-learn Template
Traditional ML algorithms
Common files
Dockerfile, tests, and shared scaffolding
Deployment
Deploy your trained model