Skip to main content

MELD

MELD is a continual-learning framework for replay-free model updates on image and text classification tasks. It gives you a reusable runner, a Python API, CLI commands, safety checks before updates, drift audits after updates, and a side-by-side comparison path against full retraining.

MELD is a good fit when you want:

  • replay-free continual-learning experiments
  • safe incremental updates on new tasks
  • direct comparison between delta updates and full retraining
  • built-in vision and NLP benchmark support
  • custom dataset adapters through Python hooks

Install

From PyPI

pip install meld-framework

From source

git clone https://github.com/anikeaty08/MELD.git
cd MELD
python -m venv .venv

PowerShell:

.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
python -m pip install .

macOS / Linux:

source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install .

Quick start

Check the installed commands:

meld --help
meld-bootstrap --help

Module form works too:

python -m meld.cli --help
python -m meld.bootstrap --help

CLI usage

Default compare mode on a small synthetic smoke run:

meld \
  --dataset synthetic \
  --num-tasks 2 \
  --classes-per-task 2 \
  --epochs 1 \
  --batch-size 8 \
  --backbone resnet20 \
  --results-path results.json

Delta-only mode:

meld \
  --dataset synthetic \
  --num-tasks 2 \
  --classes-per-task 2 \
  --run-mode delta \
  --epochs 1 \
  --batch-size 8 \
  --backbone resnet20 \
  --results-path results_delta.json

Full-retrain mode:

meld \
  --dataset synthetic \
  --num-tasks 2 \
  --classes-per-task 2 \
  --run-mode full_retrain \
  --epochs 1 \
  --batch-size 8 \
  --backbone resnet20 \
  --results-path results_full_retrain.json

Text benchmark example:

meld \
  --dataset AGNews \
  --num-tasks 1 \
  --classes-per-task 4 \
  --epochs 1 \
  --batch-size 8 \
  --backbone text_encoder \
  --text-encoder-model sentence-transformers/all-MiniLM-L6-v2 \
  --num-workers 0 \
  --results-path results_agnews.json

Python API

from meld import MELDConfig, TrainConfig, run

results = run(
    MELDConfig(
        dataset="synthetic",
        num_tasks=2,
        classes_per_task=2,
        run_mode="compare",
        bound_tolerance=10.0,
        train=TrainConfig(
            backbone="resnet20",
            epochs=1,
            batch_size=8,
        ),
    ),
    results_path="results.json",
)

print(results["final_summary"])

Run modes:

  • compare: run MELD delta updates and a full-retrain baseline side by side
  • delta: run only the replay-free update path
  • full_retrain: always retrain on all seen task data

Dataset preparation

Download benchmark assets before the first run:

meld-bootstrap --datasets CIFAR-10 CIFAR-100 --data-root ./data

Bootstrap helper coverage:

  • CIFAR-10
  • CIFAR-100
  • CIFAR-10-C

Runner dataset coverage:

  • synthetic
  • CIFAR-10
  • CIFAR-100
  • STL-10
  • TinyImageNet
  • AGNews
  • DBpedia
  • YahooAnswersNLP

TinyImageNet still expects a manually extracted tiny-imagenet-200 folder inside the selected data root.

Backbones

Available backbone choices:

  • auto
  • resnet20
  • resnet32
  • resnet44
  • resnet56
  • resnet18_imagenet
  • text_encoder

Common text encoders:

  • sentence-transformers/all-MiniLM-L6-v2
  • sentence-transformers/all-MiniLM-L12-v2
  • sentence-transformers/all-mpnet-base-v2
  • sentence-transformers/paraphrase-MiniLM-L6-v2
  • bert-base-uncased
  • distilbert-base-uncased

Custom datasets

You can register your own dataset provider through the Python API. A provider returns a list of (train_dataset, test_dataset) pairs, one pair per continual-learning task.

import torch
from torch.utils.data import TensorDataset

from meld import MELDConfig, TrainConfig, register_dataset, run
from meld.datasets import split_classification_dataset_into_tasks


def my_dataset_provider(config: MELDConfig):
    train = TensorDataset(
        torch.randn(12, 3, 32, 32),
        torch.tensor([0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3]),
    )
    test = TensorDataset(
        torch.randn(8, 3, 32, 32),
        torch.tensor([0, 0, 1, 1, 2, 2, 3, 3]),
    )
    return split_classification_dataset_into_tasks(
        train,
        test,
        num_tasks=config.num_tasks,
        classes_per_task=config.classes_per_task,
    )


register_dataset("MyDataset", my_dataset_provider, overwrite=True)

results = run(
    MELDConfig(
        dataset="MyDataset",
        num_tasks=2,
        classes_per_task=2,
        run_mode="compare",
        train=TrainConfig(backbone="resnet20", epochs=1, batch_size=8),
    )
)

macOS notes

  • MELD automatically uses Apple mps when it is available.
  • --prefer-cuda is only relevant on CUDA-capable NVIDIA setups.
  • Keep --num-workers 0 when you first smoke-test on macOS. That is the default and it avoids DataLoader worker-spawn surprises.

Troubleshooting

  • If an image dataset run says Continuum is required, install the full package dependencies with pip install . or pip install meld-framework.
  • If a text run fails because a model or dataset is missing, retry once with an active internet connection so Hugging Face assets can be cached locally.
  • If you only want a quick correctness check, start with synthetic, --epochs 1, and --num-workers 0.

Verification

Current release checks used for this package:

  • python -m pytest tests -q
  • python -m build
  • python -m twine check dist/*

A GitHub Actions matrix is also included to exercise install and test flows on Windows, macOS, and Linux.

For local development tools:

python -m pip install '.[dev]'

Metadata

Release files for meld-framework 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for meld-framework 0.1.0
File Size Uploaded Provenance Actions
meld_framework-0.1.0.tar.gz 247.5 kB Without provenance Details for meld_framework-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for meld-framework 0.1.0
File Interpreter ABI Platform Actions
meld_framework-0.1.0-py3-none-any.whl Python 3 none any Details for meld_framework-0.1.0-py3-none-any.whl

Total release size: 504.6 kB

Release files / meld_framework-0.1.0.tar.gz

Download URL meld_framework-0.1.0.tar.gz
Size 247.5 kB
Tags Source
SHA-256 checksum
How to use checksums
35f4b4d5a42cf6c44c740102cb2fb5bea61c56f6e88072998e970d7f8e2243a1
BLAKE2b-256 checksum
How to use checksums
c6313c6c67f6d72c16a01a53aa05a16f4b89cff46e53cba74a1e11c1a7ffb7f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / meld_framework-0.1.0-py3-none-any.whl

Download URL meld_framework-0.1.0-py3-none-any.whl
Size 257.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
51e4736edcb363efa6c1dd2df8d0e98c978ef55778045c5ab7ebeca96d604fe5
BLAKE2b-256 checksum
How to use checksums
89b1a48df596784533b5f8ee9523a2a6d51340c419452ec29aaadaccda602d87
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Security for meld-framework 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page