Examples¶
Learn Tracelet through practical examples in the /examples
directory. Each category demonstrates different aspects of experiment tracking.
Quick Examples¶
Basic Tracking¶
from tracelet import Experiment
# Create experiment with automatic detection
exp = Experiment(name="my_model", backend=["wandb"], automagic=True)
exp.start()
# Your existing training code - metrics logged automatically
for epoch in range(10):
loss = model.train_one_epoch()
print(f"Loss: {loss}")
exp.stop()
Artifact Tracking¶
from tracelet.core.artifacts import ArtifactType
# Log a trained model
model_artifact = exp.create_artifact(
name="classifier",
artifact_type=ArtifactType.MODEL
).add_file("model.pth", "model/classifier.pth")
exp.log_artifact(model_artifact)
Detailed Examples¶
Manual Tracking¶
Step-by-step introduction to manual metric logging and parameter tracking.
Multi-Backend¶
Compare MLflow, ClearML, and W&B backends with the same experiment.
Notebooks¶
Jupyter notebook examples with visualizations and interactive exploration.
Repository Examples¶
The /examples
directory contains runnable examples organized by complexity:
01_manual_tracking/
- Basic manual tracking examples02_automagic_tracking/
- Zero-config automatic tracking03_backend_integrations/
- Backend-specific features04_advanced_features/
- Production-ready patterns05_lightning_automagic/
- PyTorch Lightning integration06_artifacts/
- Artifact management examples
Quick Start Path¶
- New to tracking:
examples/01_manual_tracking/01_basic_manual.py
- Want zero config:
examples/02_automagic_tracking/01_basic_automagic.py
- Use PyTorch Lightning:
examples/05_lightning_automagic/simple_lightning_example.py
- Compare backends:
examples/03_backend_integrations/compare_all_backends.py
Running Examples¶
All examples use synthetic data and can be run immediately:
For multi-backend examples, install the required backends: