Agent code for the Autonomous Formulation Lab
Project description
AFL-agent: Autonomous Active Learning Agent for Material Science
AFL-agent is a Python library that implements the autonomous active learning agent described in the manuscript "Autonomous Small-Angle Scattering for Accelerated Soft Material Formulation Optimization". The library is designed to autonomously guide experimental measurement campaigns to efficiently map phase boundaries in soft material formulations using advanced machine learning techniques.
Overview
The AFL-agent library offers robust tools for building autonomous active learning agents tailored for material science applications. It integrates machine learning techniques with experimental design strategies to optimize experimental campaigns and efficiently map phase boundaries and optimize material properties in soft material formulations.
Key Features:
- Library of machine learning operations that can be composed into pipelines
- Pipelines are modular, visualizable, serializable, and self-documenting
- Trivial support for multimodal data processing
- All intermediate pipeline operations are stored in a xarray-based data model
- Rich visualization tools for analyzing calculations
Installation
pip install git+https://github.com/usnistgov/afl-agent
Quick Start
Below is an example showcasing how to build a pipeline for choosing a sample composition
from AFL.double_agent import *
import numpy as np
import xarray as xr
with Pipeline() as pipeline:
SavgolFilter(
input_variable='measurement',
output_variable='derivative',
dim='x',
derivative=1
)
Similarity(
input_variable='derivative',
output_variable='similarity',
params={'metric': 'cosine'}
)
SpectralClustering(
input_variable='similarity',
output_variable='labels',
)
GaussianProcessClassifier(
feature_input_variable='composition',
predictor_input_variable='labels',
output_prefix='extrap',
)
MaxValueAF(
input_variable='extrap_variance',
output_variable='next_sample'
)
# Generate synthetic data
n_samples = 10
n_points = 100
x = np.linspace(0, 10, n_points)
measurements = ... # data from your measurement
compositions = ... # composition of your samples
# Create dataset
ds = xr.Dataset(
data_vars={
'measurement': (['sample', 'x'], measurements),
'composition': (['sample', 'components'], compositions)
},
coords={
'x': x,
'components': ['A', 'B', 'C']
}
)
# Run the pipeline
ds_out = pipeline.calculate(ds)
#ds_out contains the following variables:
# - measurement: the original measurement data
# - derivative: the first derivative of the measurement data
# - similarity: the similarity between the samples
# - labels: the labels assigned to the samples
# - extrap_variance: the variance of the Gaussian process prediction
# - next_sample: the next sample to measure
Citation
If you use AFL-agent in your research, please cite the manuscript:
"Autonomous Small-Angle Scattering for Accelerated Soft Material Formulation Optimization" (under review)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file afl_agent-1.3.1.tar.gz.
File metadata
- Download URL: afl_agent-1.3.1.tar.gz
- Upload date:
- Size: 366.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9a650c40cbc1cc6f2f7ffae29eec08225103e2e8c4310d0f58d53d3e5368591
|
|
| MD5 |
f28925e3173a77333e2cf8c0bcce818a
|
|
| BLAKE2b-256 |
ed234a032c01501183a96e2f0a51710633ee736d9e90bf9ca075af3fc03c4d17
|
Provenance
The following attestation bundles were made for afl_agent-1.3.1.tar.gz:
Publisher:
publish_pypi.yml on usnistgov/AFL-agent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
afl_agent-1.3.1.tar.gz -
Subject digest:
e9a650c40cbc1cc6f2f7ffae29eec08225103e2e8c4310d0f58d53d3e5368591 - Sigstore transparency entry: 238343476
- Sigstore integration time:
-
Permalink:
usnistgov/AFL-agent@434944a2510e8e5b6f2ac45d9fceedd1372fbdc1 -
Branch / Tag:
refs/tags/v1.3.1 - Owner: https://github.com/usnistgov
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_pypi.yml@434944a2510e8e5b6f2ac45d9fceedd1372fbdc1 -
Trigger Event:
release
-
Statement type:
File details
Details for the file afl_agent-1.3.1-py3-none-any.whl.
File metadata
- Download URL: afl_agent-1.3.1-py3-none-any.whl
- Upload date:
- Size: 401.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
32e22224f466fa2b678576e0b5561647629780ada46e3f8d7f8305abd12ade7b
|
|
| MD5 |
eeb7aba15d26321292027aa385c9cf64
|
|
| BLAKE2b-256 |
0f27e5685607f10793177c71c005170a2fa69c1e9f3be21d6fdf36702dfc0a62
|
Provenance
The following attestation bundles were made for afl_agent-1.3.1-py3-none-any.whl:
Publisher:
publish_pypi.yml on usnistgov/AFL-agent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
afl_agent-1.3.1-py3-none-any.whl -
Subject digest:
32e22224f466fa2b678576e0b5561647629780ada46e3f8d7f8305abd12ade7b - Sigstore transparency entry: 238343480
- Sigstore integration time:
-
Permalink:
usnistgov/AFL-agent@434944a2510e8e5b6f2ac45d9fceedd1372fbdc1 -
Branch / Tag:
refs/tags/v1.3.1 - Owner: https://github.com/usnistgov
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_pypi.yml@434944a2510e8e5b6f2ac45d9fceedd1372fbdc1 -
Trigger Event:
release
-
Statement type: