Skip to main content

ALF alf-core

PyPI Python Version License Coverage Docs

The lightweight, dependency-minimal foundation of ALF (Active Learning Framework).

alf-core provides the base classes, core data structures, and the active-learning loop for iterative optimisation in computational science — optimising high-dimensional, combinatorially vast search spaces where each label is expensive (wet-lab assays, simulations, measurements). It ships with no ML-framework dependencies (only numpy, pandas, scipy), so it is standalone and domain-agnostic. For ready-to-use models, datasets, and acquisition functions, install alf-tools.

ALF Components

Installation

pip install alf-core

Quick start

alf-core is the framework layer: you supply your own BaseDataset and BaseModel subclasses (or install alf-tools for ready-made ones), then wire them into the active-learning loop.

from alf_core import (
    DatasetSearch,
    DesignTask,
    Optimizer,
    Oracle,
    Surrogate,
    TerminalStateLogger,
)

# Bring your own BaseDataset, BaseModel, and AcquisitionFunction subclasses
dataset = MyDataset(...)
surrogate = Surrogate(model=MyModel())
optimizer = Optimizer(acquisition_fn=MyAcquisition(), search_fn=DatasetSearch())
oracle = Oracle(scorer=dataset)

# Run the active-learning loop for 5 rounds, acquiring 100 candidates per round
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,
)

For a complete, runnable alf-core-only example (a bootstrap-ensemble surrogate and a Probability of Improvement acquisition function built from scratch with numpy/scipy), see the ALF Core Quickstart notebook.

Key concepts

ALF runs the active-learning loop over a small set of swappable components:

  • Dataset (BaseDataset) — loads, splits, and queries candidate data
  • Model (BaseModel) — the surrogate/oracle/generator backbone you implement
  • Surrogate (Surrogate) — wraps a model to predict fitness and uncertainty
  • Oracle (Oracle) — returns ground-truth labels (offline pool or live scorer)
  • Optimizer (Optimizer) — proposes the next batch via acquisition + search
  • Acquisition function (AcquisitionFunction) — scores candidates to acquire
  • Search strategy (BaseSearch) — defines the candidate pool to score
  • State (State) — tracks rounds, history, and metrics across the loop
  • Tasks (DesignTask, SupervisedTask, ZeroShotTask) — drive the multi-round loop, fixed-data training, or no-train evaluation

Documentation

License

Apache License 2.0 — see LICENSE.

Metadata

Release files for alf_core 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 alf_core 0.1.0
File Size Uploaded
alf_core-0.1.0.tar.gz 48.8 kB Details

Built distribution (wheel)

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

Total release size: 116.9 kB

Release files / alf_core-0.1.0.tar.gz

Download URL alf_core-0.1.0.tar.gz
Size 48.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e11d2c71d06b050e1150ab639ff93f1a36183d9ad496515718d462b66faccae2
BLAKE2b-256 checksum
How to use checksums
ab412a9d2e327078f1dc7937bbfaf55a930e14f0145430f0840a26adac69a5e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.20 {"installer":{"name":"uv","version":"0.12.20","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}

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

Download URL alf_core-0.1.0-py3-none-any.whl
Size 68.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1d28f16285b50d5106f2a9cb534068d46c26ba2cc73df4bc07ba33c64c6afdbe
BLAKE2b-256 checksum
How to use checksums
c6d2b012de334fe8d220ee39513a5352b52b420c2be8a0a3f34df3361e37b07a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.20 {"installer":{"name":"uv","version":"0.12.20","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}

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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