Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

ALF alf-tools

PyPI Python Version License Coverage Docs

Ready-to-use models, datasets, and acquisition functions for ALF (Active Learning Framework).

alf-tools builds on alf-core to give you everything needed to run active-learning experiments out of the box — example datasets (GFP, ProteinGym, FLIP, GuacaMol), models (CNN, Gaussian Process, ESM-2, Chemprop), acquisition functions, and search strategies. Use it for quick-start and prototyping; reach for alf-core alone when you want the lightweight framework with no ML-framework dependencies.

ALF active-learning loop overview

Installation

pip install alf-tools

This installs PyTorch and the core dependencies. Some models need additional dependencies — see Optional Extras below.

Optional Extras

Some models require additional dependencies. Append one or more extras to the package name. Per-model extras (esm2, esmfold, chemprop, guacamol) install exactly one model's dependencies; workflow umbrellas (protein, molecule) group the extras you are likely to use together.

pip install "alf-tools[esm2]"      # ESM-2 protein language model (ESM2Model)
pip install "alf-tools[esmfold]"   # ESMFold structure-prediction oracle (ESMFoldModel)
pip install "alf-tools[chemprop]"  # Chemprop small-molecule MPNN (ChempropModel)
pip install "alf-tools[guacamol]"  # GuacaMol RDKit-based dataset/scoring
pip install "alf-tools[protein]"   # umbrella: esm2 + esmfold
pip install "alf-tools[molecule]"  # umbrella: chemprop + guacamol

Documentation

What's included

alf-tools bundles example datasets (GFP, ProteinGym, FLIP, GuacaMol), surrogate and oracle models (CNN, Gaussian Process, ESM-2, ESMFold, Chemprop, PyRosetta, plus an ensemble wrapper), acquisition functions (Greedy, UCB, Expected Improvement, Thompson Sampling, CoreSet, and a BoTorch wrapper), and search strategies. See the API reference for the full catalogue and configuration options.

Quick example

from alf_core import (
    BaseDatasetConfig,
    DatasetSearch,
    DesignTask,
    Optimizer,
    Oracle,
    Surrogate,
    TerminalStateLogger,
)
from alf_tools.datasets import GFP
from alf_tools.models import CNNModel
from alf_tools.optimizer.acquisition_functions import Greedy

# Configure and load the dataset
config = BaseDatasetConfig(
    name="gfp",
    modality="sequence",
    seed=42,
    train_ratio=0.1,
    validation_frac=0.5,
    test_ratio=0.2,
    split_type="random",
    problem_type="regression",
)
dataset = GFP(config)
surrogate = Surrogate(model=CNNModel())
optimizer = Optimizer(acquisition_fn=Greedy(), search_fn=DatasetSearch())
oracle = Oracle(scorer=dataset)

# Run active learning
task = DesignTask(num_acq_rounds=5, acq_batch_size=100)
state = task.setup(dataset=dataset, surrogate=surrogate)
task.run(
    state=state,
    state_loggers=[TerminalStateLogger()],
    optimizer=optimizer,
    oracle=oracle,
)

Normalisation

Models support input normalisation and output standardisation through their train configs (BaseTrainConfig). GPModel enables both by default (minmax inputs, standardised outputs); the other models default to neither. See the API reference for per-model defaults and configuration.

Creating custom components

All components subclass the alf_core base classes (BaseDataset, BaseModel, AcquisitionFunction, BaseSearch). See the how-to guides for step-by-step instructions.

License

Apache License 2.0 — see LICENSE.

Download files

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

Source Distribution

alf_tools-0.1.0b0.tar.gz (102.0 kB view details)

Uploaded Source

Built Distribution

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

alf_tools-0.1.0b0-py3-none-any.whl (136.6 kB view details)

Uploaded Python 3

File details

Details for the file alf_tools-0.1.0b0.tar.gz.

File metadata

  • Download URL: alf_tools-0.1.0b0.tar.gz
  • Upload date:
  • Size: 102.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for alf_tools-0.1.0b0.tar.gz
Algorithm Hash digest
SHA256 54d36add558419e146d609318b77c3e027145e5e8727ed5b4c32d3bb47fb3c8c
MD5 ca3492bad40d52ee813d7f6d95624994
BLAKE2b-256 ec13e19cb026462fe113b62f64d48e5d16e382786bb1fe99b9771eecff89fdc6

See more details on using hashes here.

File details

Details for the file alf_tools-0.1.0b0-py3-none-any.whl.

File metadata

  • Download URL: alf_tools-0.1.0b0-py3-none-any.whl
  • Upload date:
  • Size: 136.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for alf_tools-0.1.0b0-py3-none-any.whl
Algorithm Hash digest
SHA256 4fbf20b56f0c0d1a9a23b3f4eb2337dbcca810ab59c77d256aca49b5b55beb3d
MD5 9ddac41131c07e1e1a79e3c8b3a80778
BLAKE2b-256 444c2240d5ae4fd4c6f51a26d6eb6e10c3905cd8b0911b1d79d31b654a03d177

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0b0 This release

2 files

Supported by

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