Skip to main content

Training-time adaptive data curriculum for PyTorch with safety guards

Project description

🛡 CurriculumGuard

Training-Time Data Control for PyTorch

CurriculumGuard is an open-source training-time control system that dynamically adapts which samples a model sees during training using live learning dynamics — while enforcing stability via rollback-based safety guards.

Models and optimizers are controlled.
Hyperparameters are tuned.
But the data stream itself has been ignored — until now.


🔥 Why CurriculumGuard?

Modern datasets are:

  • Noisy
  • Imbalanced
  • Web-scraped
  • Non-stationary

CurriculumGuard introduces a missing layer in ML infrastructure:

Adaptive Data Curriculum with Stability-First Control


⚙ Installation

pip install curriculumguard

🚀 Quick Start

1️⃣ Dataset must return sample IDs

def __getitem__(self, idx):
    return idx, data, label

2️⃣ Wrap training loop

from curriculum_guard.core.guard import CurriculumGuard
from curriculum_guard.sampler.adaptive_sampler import AdaptiveSampler

guard = CurriculumGuard(train_dataset)

for epoch in range(epochs):
    sampler = AdaptiveSampler(train_dataset, guard.bucketer.bucketize(), guard.weights)
    loader = DataLoader(train_dataset, sampler=sampler)

    for ids, x, y in loader:
        logits = model(x)
        loss   = criterion(logits, y)
        guard.profiler.update(ids, loss.detach(), logits.detach(), y)
        loss.mean().backward()
        optimizer.step()
        optimizer.zero_grad()

🧠 Signals Observed

Signal Meaning
EMA loss Sample difficulty
Loss variance Label noise
Prediction entropy Model uncertainty
Forgetting events Harmful samples
Exposure count Over-training risk

🛡 Safety

CurriculumGuard enforces rollback when instability or regression is detected.

Policy is advisory. Safety is authoritative.


📊 Benchmarks

Task Baseline CurriculumGuard
AG News + Noise 68% 74%
FashionMNIST 35% noise 84% 87.5%
Fraud Recall slow fast high recall
Continual Drift fragile stable

📜 License

MIT

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

curriculumguard-0.1.1.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

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

curriculumguard-0.1.1-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file curriculumguard-0.1.1.tar.gz.

File metadata

  • Download URL: curriculumguard-0.1.1.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for curriculumguard-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f521c3abbeafab628f87c5e131ba926dc52b2ed6d146f7ba5db04eefbffe319a
MD5 21060e9ee2f79d1b708180d30acfb342
BLAKE2b-256 378035c79f54bb3e3d7830bf0ee82b80c43c2c127101c0d3c09ac9a9e7833b62

See more details on using hashes here.

File details

Details for the file curriculumguard-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for curriculumguard-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 349ee94d85a81a91487477cd62338059cc7cf4e5f8a82db3a7a1d06f0c91f00c
MD5 52702490270f7dd9e5f8b61ca9bb39d2
BLAKE2b-256 56102ff324ac3fb3461b0f584b8f1b47d26ab0a7ffb5beafa4db366c69852381

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