Skip to main content

Yet Another Experiment Tracker - A lightweight experiment tracking harness

Project description

Yanex - Yet Another Experiment Tracker

A lightweight, Git-aware experiment tracking system for Python that makes reproducible research effortless.

Why Yanex?

Stop losing track of your experiments. Yanex automatically tracks parameters, results, and code state so you can focus on what matters - your research.

import yanex

# read parameters from config file or CLI arguments
lr = yanex.get_param('lr', default=0.001)
epochs = yanex.get_param('epochs', default=10)

# your experiment code
# ...

# log results, artifacts and figures
yanex.log_results({"step": epoch, "loss", loss, "accuracy": accuracy})
yanex.log_artifact("model.pth", model_path)
yanex.log_matplotlib_figure(fig, "loss_curve.png")

Run from the command line:

# Run with yanex CLI for automatic tracking
yanex run train.py --param lr=10e-3 --param epochs=10

That's it. Yanex creates a separate directory for each experiment, saves the logged results and files, stdout and stderr outptus, Python environment information, and even the Git state of your code repository. You can then compare results, search experiments, and reproduce them with ease.

Key Features

  • 🔒 Reproducible: Automatic Git state tracking ensures every experiment is reproducible
  • 📊 Interactive Comparison: Compare experiments side-by-side with an interactive table
  • ⚙️ Flexible Parameters: YAML configs with CLI overrides for easy experimentation and syntax for parameter sweeps
  • 📈 Rich Logging: Track metrics, artifacts, and figures
  • 🔍 Powerful Search: Find experiments by status, parameters, tags, or time ranges
  • 📦 Zero Dependencies: No external services required - works offline

Quick Start

Install

pip install yanex

1. Run Your First Experiment

# experiment.py
import yanex

params = yanex.get_params()
print(f"Learning rate: {params.get('learning_rate', 0.001)}")

# Simulate training
accuracy = 0.85 + (params.get('learning_rate', 0.001) * 10)

yanex.log_results({
    "accuracy": accuracy,
    "loss": 1 - accuracy
})
# Run with default parameters
yanex run experiment.py

# Override parameters
yanex run experiment.py --param learning_rate=0.01 --param epochs=50

# Add tags for organization
yanex run experiment.py --tag baseline --tag "quick-test"

2. Compare Results

# Interactive comparison table
yanex compare

# Compare specific experiments
yanex compare exp1 exp2 exp3

# Filter and compare
yanex compare --status completed --tag baseline

3. Track Everything

List, search, and manage your experiments:

# List recent experiments
yanex list

# Find experiments by criteria
yanex list --status completed --tag production
yanex list --started-after "1 week ago"

# Show detailed experiment info
yanex show exp_id

# Archive old experiments
yanex archive --started-before "1 month ago"

Two Ways to Use Yanex

Yanex supports two usage patterns:

1. CLI-First (Recommended)

Write scripts that work both standalone and with yanex tracking:

# train.py - Works both ways!
import yanex

params = yanex.get_params()  # Gets parameters or defaults
lr = params.get('learning_rate', 0.001)

# Your training code
accuracy = train_model(lr=lr)

# Logging works in both contexts
yanex.log_results({"accuracy": accuracy})
# Run standalone (no tracking)
python train.py

# Run with yanex (full tracking)
yanex run train.py --param learning_rate=0.01

2. Explicit Experiment Creation (Advanced)

For Jupyter notebook usage, or when you need fine control:

import yanex
from pathlib import Path

experiment = yanex.create_experiment(script_path=Path(__file__), name="my-exp", config={"lr": 0.01})

with experiment:
    
    # Your code here
    # ...

    yanex.log_results({"accuracy": 0.95})

Note: Don't mix both patterns! Use CLI-first for most cases, explicit creation for advanced scenarios.

Configuration Files

Create config.yaml for default parameters:

# config.yaml
model:
  learning_rate: 0.001
  batch_size: 32
  epochs: 100

data:
  dataset: "cifar10"
  augmentation: true

training:
  optimizer: "adam"
  scheduler: "cosine"

Documentation

📚 Complete Documentation - Detailed guides and API reference

Quick Links:

Contributing

Yanex is open source and welcomes contributions! See our contributing guidelines for details.

Built with assistance from Claude.

License

MIT License - see LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yanex-0.2.0.tar.gz (88.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yanex-0.2.0-py3-none-any.whl (84.0 kB view details)

Uploaded Python 3

File details

Details for the file yanex-0.2.0.tar.gz.

File metadata

  • Download URL: yanex-0.2.0.tar.gz
  • Upload date:
  • Size: 88.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for yanex-0.2.0.tar.gz
Algorithm Hash digest
SHA256 4df7fb0bbaf738d8a3c2e5001a1519128db0072b343d0ad0f8515ab5bbe3d084
MD5 9c18ac60ece31acb16127a8895aecd82
BLAKE2b-256 e2b5ae0bdb9de8aa8f55fb0184111710ea2db3a092e2c969e917903c212940e6

See more details on using hashes here.

File details

Details for the file yanex-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: yanex-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 84.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for yanex-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ad2388027e9a8601238767de05f202b8b43160b6dc061dae1f05217aa9a3b304
MD5 e9370008bfcfcddc114d87f9d2acc571
BLAKE2b-256 b01c9b4fe8f9623047f4fe0d2486b0a4e3350050fb1198f0fc11373b1bc0e0b6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page