Skip to main content

Model Ablation Tool-Kit

Project description

Ablator Image

Documentation Twitter Follow Discord Slack

Version Python 3.10 codecov

🚀 ABLATOR is a DISTRIBUTED EXECUTION FRAMEWORK designed to enhance ablation studies in complex machine learning models. It automates the process of configuration and conducts multiple experiments in parallel.

What are Ablation Studies?

It involves removing specific parts of a neural network architecture or changing different aspects of the training process to examine their contributions to the model's performance.

Why ABLATOR?

As machine learning models grow in complexity, the number of components that need to be ablated also increases. This consequently expands the search space of possible configurations, requiring an efficient approach to horizontally scale multiple parallel experimental trials. ABLATOR is a tool that aids in the horizontal scaling of experimental trials.

Instead of manually configuring and conducting multiple experiments with various hyperparameter settings, ABLATOR automates this process. It initializes experiments based on different hyperparameter configurations, tracks the state of each experiment, and provides experiment persistence on the cloud.

Key Features

  • It is a tool that simplifies the process of prototyping of models.
  • It streamlines model experimentation and evaluation.
  • It offers a flexible configuration system.
  • It facilitates result interpretation through visualization.
  • "Auto-Trainer" feature reduces redundant coding tasks.

ABLATOR vs. Without ABLATOR

Left, ABLATOR efficiently conducts multiple trials in parallel based and log the experiment results.

Right, manually, one would need to run trials sequentially, demanding more effort and independent analysis.

Comparison of ABLATOR and Manual Proces

Install

For MacOS and Linux systems directly install via pip.

pip install ablator

If you are using Windows, you will need to install WSL using the official from Microsoft.

WSL is a Linux subsystem and for ABLATOR purposes is identical to using Linux.

Basic Concepts

1. Create your Configuration

from torch import nn
import torch
from ablator import (
    ModelConfig,
    ModelWrapper,
    OptimizerConfig,
    TrainConfig,
    configclass,
    Literal,
    ParallelTrainer,
    SearchSpace,
)
from ablator.config.mp import ParallelConfig


@configclass
class TrainConfig(TrainConfig):
    dataset: str = "random"
    dataset_size: int


@configclass
class ModelConfig(ModelConfig):
    layer: Literal["layer_a", "layer_b"] = "layer_a"


@configclass
class ParallelConfig(ParallelConfig):
    model_config: ModelConfig
    train_config: TrainConfig


config = ParallelConfig(
    experiment_dir="ablator-exp",
    train_config=TrainConfig(
        batch_size=128,
        epochs=2,
        dataset_size=100,
        optimizer_config=OptimizerConfig(name="sgd", arguments={"lr": 0.1}),
        scheduler_config=None,
    ),
    model_config=ModelConfig(),
    device="cpu",
    search_space={
        "model_config.layer": SearchSpace(categorical_values=["layer_a", "layer_b"])
    },
    total_trials=2,
)

2. Define your Model

class SimpleModel(nn.Module):
    def __init__(self, config: ModelConfig) -> None:
        super().__init__()
        if config.layer == "layer_a":
            self.param = nn.Parameter(torch.ones(100, 1))
        else:
            self.param = nn.Parameter(torch.randn(200, 1))

    def forward(self, x: torch.Tensor):
        x = self.param
        return {"preds": x}, x.sum().abs()


class SimpleWrapper(ModelWrapper):
    def make_dataloader_train(self, run_config: ParallelConfig):
        dl = [torch.rand(100) for i in range(run_config.train_config.dataset_size)]
        return dl

    def make_dataloader_val(self, run_config: ParallelConfig):
        dl = [torch.rand(100) for i in range(run_config.train_config.dataset_size)]
        return dl

3. Launch 🚀

mywrapper = SimpleWrapper(SimpleModel)
with ParallelTrainer(mywrapper, config) as ablator:
    ablator.launch(".")

Learn More about ABLATOR Modules

Configuration Icon Process Icon Results Icon Analysis Icon
Configuration Module Training Module Experiment and Metrics Module Analysis Module

Tutorials

Explore a variety of tutorials and examples on how to utilize ABLATOR. Ready to dive in? 👉 Ablation Tutorials

Contribution Guidelines

ABLATOR is open source, and we value contributions from our community! Check out our Development Guide for details on our development process and insights into the internals of the ABLATOR library.

For any bugs or feature requests related to ABLATOR, please visit our GitHub Issues or reach out to slack

Ablator Community

Platform Purpose Support Level
GitHub Issues To report issues or suggest new features. ABLATOR Team
Slack To collaborate with fellow ABLATOR users. Community
Discord To inquire about ABLATOR usage and collaborate with other ABLATOR enthusiasts. Community
Twitter For staying up-to-date on new features of Ablator. ABLATOR Team

References

@inproceedings{fostiropoulos2023ablator,
  title={ABLATOR: Robust Horizontal-Scaling of Machine Learning Ablation Experiments},
  author={Fostiropoulos, Iordanis and Itti, Laurent},
  booktitle={AutoML Conference 2023 (ABCD Track)},
  year={2023}
}

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

ablator-0.0.1b3.tar.gz (231.6 kB view details)

Uploaded Source

Built Distributions

ablator-0.0.1b3-py3-none-manylinux2014_x86_64.whl (261.1 kB view details)

Uploaded Python 3

ablator-0.0.1b3-py3-none-manylinux2014_s390x.whl (261.1 kB view details)

Uploaded Python 3

ablator-0.0.1b3-py3-none-manylinux2014_ppc64.whl (261.1 kB view details)

Uploaded Python 3

ablator-0.0.1b3-py3-none-manylinux2014_i686.whl (261.1 kB view details)

Uploaded Python 3

ablator-0.0.1b3-py3-none-manylinux2014_armv7l.whl (261.1 kB view details)

Uploaded Python 3

ablator-0.0.1b3-py3-none-macosx_11_0_arm64.whl (261.1 kB view details)

Uploaded Python 3 macOS 11.0+ ARM64

ablator-0.0.1b3-py3-none-macosx_10_9_x86_64.whl (261.1 kB view details)

Uploaded Python 3 macOS 10.9+ x86-64

File details

Details for the file ablator-0.0.1b3.tar.gz.

File metadata

  • Download URL: ablator-0.0.1b3.tar.gz
  • Upload date:
  • Size: 231.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.13

File hashes

Hashes for ablator-0.0.1b3.tar.gz
Algorithm Hash digest
SHA256 7efe82b4cd6982a4caf29bc286f68edc5e749d1df5c70f28aaaec7a09eeb6e84
MD5 1a902940b406143ed6117fe9ba42d452
BLAKE2b-256 51d457fdb510d2a4dc7580548c9e0a282f32973ded620a1140f9605b12784647

See more details on using hashes here.

File details

Details for the file ablator-0.0.1b3-py3-none-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ablator-0.0.1b3-py3-none-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3fe9b51e7f0621cfc0ffc159b11fffd75c92f82badfa7be66caf6e84ae40b9ce
MD5 b0f3b96b7b0bf910d1d285c029c26a81
BLAKE2b-256 6d25b5174edd093f39f316b433de3c1d7e15b2730ce043406975e25d954dcd10

See more details on using hashes here.

File details

Details for the file ablator-0.0.1b3-py3-none-manylinux2014_s390x.whl.

File metadata

File hashes

Hashes for ablator-0.0.1b3-py3-none-manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 d515a9bb1615e73e82032c8fbf286596456439cac1c60ff05ad04fa902383e62
MD5 fa9d88727a42ee9860bcf7e738a0ec0f
BLAKE2b-256 482a58faee84cb7d9bfce4f01c730abe05fc72a073ae1ce900628854d0414f66

See more details on using hashes here.

File details

Details for the file ablator-0.0.1b3-py3-none-manylinux2014_ppc64le.whl.

File metadata

File hashes

Hashes for ablator-0.0.1b3-py3-none-manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 628dc4f1bf9d9ee65481d535c4db4a882651d0a738d512ba9305eda89851e566
MD5 614c99cb259f97de115d36d7fd01ea06
BLAKE2b-256 b681506a4342d92b893712c912ff4105aa83425c09c397792cd1d12a729e6c2f

See more details on using hashes here.

File details

Details for the file ablator-0.0.1b3-py3-none-manylinux2014_ppc64.whl.

File metadata

File hashes

Hashes for ablator-0.0.1b3-py3-none-manylinux2014_ppc64.whl
Algorithm Hash digest
SHA256 d1b33ee8646c82155ef533ed1b37b7a34b3aec084dbdd5651a720acfb61004bb
MD5 76fc86e3c5731eb8e37e7a34f968a100
BLAKE2b-256 f825e3ee4f2de313086744342421814fef2f2ffc7cee59cdd9a03afae2336e64

See more details on using hashes here.

File details

Details for the file ablator-0.0.1b3-py3-none-manylinux2014_i686.whl.

File metadata

File hashes

Hashes for ablator-0.0.1b3-py3-none-manylinux2014_i686.whl
Algorithm Hash digest
SHA256 3ba1d5d8cab262ad84b135381904867f4a8b06b0f208bfeef9ae9e0c667ad74a
MD5 344fe65f0c22a374ff779154e20065ef
BLAKE2b-256 ee7af6b2f66be6300dce76af43653b1ab647f7955000facd7f7a3588b9158334

See more details on using hashes here.

File details

Details for the file ablator-0.0.1b3-py3-none-manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for ablator-0.0.1b3-py3-none-manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 4bff584827b26c43fc9e88fb46beb15bd5defa2cad564a3ea2824bb31e1584db
MD5 6ce29e7ef035f2c866751350502f6f7b
BLAKE2b-256 65f2d211be0016846aa89d88deecaf80c0043f05d03ad5abcef263027333d626

See more details on using hashes here.

File details

Details for the file ablator-0.0.1b3-py3-none-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for ablator-0.0.1b3-py3-none-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f07048aea38ee9104a5b59a5a7f1fa2dd380ed3363b45f95258134c8a4e48aa3
MD5 0c46c256dc99f36571316933a9499725
BLAKE2b-256 80b1e1a12ac1b88dbc68ad4f31d558f911be4f433a3006778490bf79383a1658

See more details on using hashes here.

File details

Details for the file ablator-0.0.1b3-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ablator-0.0.1b3-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 248cd1a14e0e748f517eae10169d187eff8449a686e5469f56d86c3aad0647b9
MD5 263379ff52cdc448c89f9812693aeff4
BLAKE2b-256 f7236fab5621b65cbf694006cfa94b8da4d1a50576d6f439a0041ecd298eec9d

See more details on using hashes here.

File details

Details for the file ablator-0.0.1b3-py3-none-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for ablator-0.0.1b3-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d7dc05ab9c66ff17df146d75372ba35c5b11e7b0ff4037fc9d5b6373dd88309e
MD5 2a66e55d4235b9f4123069d5270dd000
BLAKE2b-256 8b6ae264bb684b8708a6e750f757a711166d2c76e307613e5524507b54f8c845

See more details on using hashes here.

Supported by

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