Skip to main content

Autonomous data acquisition

Reason this release was yanked:

Accidental version tag, not part of the gpCAM 8.x release line.

Project description

gpCAM

PyPI Documentation Status gpCAM CI Codecov PyPI - License DOI Pepy Total Downloads Downloads

[!WARNING] gpCAM 8.4.0 is a beta release. It targets fvgp ~= 4.8 and renames a few constructor kwargs (gp2Scale_dask_client → dask_client, gp2Scale_linalg_mode → linalg_mode, gp_rank_n_update → rank_n_update) and removes calc_inv in favor of linalg_mode="CholInv". If you hit issues, pin gpcam==8.3.9 while you report — 8.3.9 remains the stable line. Full migration notes are in HISTORY.rst.

gpCAM (gpcam.lbl.gov) is an API and software designed to make advanced Gaussian Process function approximation and autonomous data acquisition/Bayesian Optimization for experiments and simulations more accurate, faster, simpler, and more widely available. The tool is based on a flexible and powerful Gaussian process regression at the core. The flexibility stems from the modular design of gpCAM which allows the user to implement and import their own Python functions to customize and control almost every aspect of the software. That makes it possible to easily tune the algorithm to account for various kinds of physics and other domain knowledge and to identify and find interesting features, in Euclidean and non-Euclidean spaces. A specialized function optimizer in gpCAM can take advantage of HPC architectures for fast analysis time and reactive autonomous data acquisition. gpCAM broke a 2019 record for the largest exact GP ever run! Below you can see a simple example of how to set up an autonomous experimentation loop.

Usage

The following demonstrates a simple usage of the gpCAM API (see interactive demo).

!pip install gpcam

from gpCAM import GPOptimizer

my_gp = GPOptimizer(x_data,y_data,)
my_gp.train()

train_at = [10,20,30] #optional
for i in range(100):
    new = my_gp.ask(np.array([[0.,1.]]))["x"]
    my_gp.tell(new, f1(new).reshape(len(new)))
    if i in train_at: my_gp.train()

Designing experiments with Claude Code

gpCAM ships with a set of Claude Code skills that guide an AI assistant through designing autonomous experiments — custom kernels, acquisition functions, noise models, and the full ask/tell/train loop. Experimentalists who want smart, autonomous data acquisition without deep knowledge of GP math or the gpCAM API can use these skills to design autonomous experiments.

Installing the gpCAM marketplace in Claude Code

The repo ships as a Claude Code plugin marketplace. Inside any Claude Code session, run:

/plugin marketplace add lbl-camera/gpCAM
/plugin install gpcam@gpcam

The first command registers this repo as a marketplace; the second installs the gpcam plugin from it, which bundles all of the skills below. After install, the skills are available to Claude in any project — no need to clone the repo locally.

To update later, run /plugin marketplace update gpcam; to remove, /plugin uninstall gpcam@gpcam.

Available skills

Skill Description
experiment-designer End-to-end autonomous experiment design. Translates a scientist's description of their measurement into a complete gpCAM script.
kernel-designer Design and compose custom kernel functions that encode domain knowledge (smoothness, periodicity, symmetry, anisotropy).
acquisition-functions Write custom acquisition functions that encode experimental priorities (exploration vs exploitation, multi-objective, constraints).
prior-mean-functions Encode known physics or expected trends as prior mean functions.
noise-functions Model position-dependent or heteroscedastic noise from detector characteristics.
cost-functions Account for motor travel time, settling, directional costs, and zone-based penalties.
gp2scale-advanced Large-scale experiments (>10k points) using sparse kernels and Dask distributed computing.
multi-task-advanced Multi-output / function-valued experiments with fvGPOptimizer.
transformed-optimizers-advanced Constrained observations: LogGPOptimizer for y > 0 and LogitGPOptimizer for y ∈ [0, 1] — predictions and credible intervals stay inside the constrained range.

Once installed, the skills activate automatically when you describe an experiment design problem to Claude, or you can invoke one explicitly (e.g. "use the experiment-designer skill to set up an adaptive XRD scan").

Other agentic platforms

The skills are also compatible with any harness that reads SKILL.md files (e.g. OpenClaw) — clone the repo and point your assistant at the skills/ directory. When this repo is present in your working directory, Claude Code also picks up the root CLAUDE.md and skills/ directory automatically, so the marketplace install is only needed for use outside the repo.

Credits

Main Developer: Marcus Noack (MarcusNoack@lbl.gov)

This code was developed with help from Ron Pandolfi (LBNL), Mark Risser (LBNL), Hengrui Luo (Rice U.), and Vardaan Tekriwal (UCB).

Additional contributions and insights came from across the community, in particular, Kevin Yager, Masafumi Fukuto, and their teams (Brookhaven National Lab).

We acknowledge support from several DOE ASCR, BER, and BES projects, including CAMERA (James Sethian, Jeff Donatelli), SPECTRA (Sherry Li), and CASCADE (Bill Collins), as well as support directly from Lawrence Berkeley National Laboratory.

This package uses the HGDL package of David Perryman and Marcus Noack, which is based on the HGDN algorithm by Noack and Funke.

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

gpcam-4.8.3.tar.gz (2.2 MB view details)

Uploaded Source

Built Distribution

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

gpcam-4.8.3-py3-none-any.whl (45.8 kB view details)

Uploaded Python 3

File details

Details for the file gpcam-4.8.3.tar.gz.

File metadata

  • Download URL: gpcam-4.8.3.tar.gz
  • Upload date:
  • Size: 2.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gpcam-4.8.3.tar.gz
Algorithm Hash digest
SHA256 4b29917e80dab8e512edcd089e27671bfb6f1138961e0df8b3a29d2d3da269ba
MD5 54f3aeb9dd1604d0715ce7704f47835d
BLAKE2b-256 9610308b5c8827dbbd93ab289d5988a1debd4a49f39fd643d362c5195254b1e1

See more details on using hashes here.

File details

Details for the file gpcam-4.8.3-py3-none-any.whl.

File metadata

  • Download URL: gpcam-4.8.3-py3-none-any.whl
  • Upload date:
  • Size: 45.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gpcam-4.8.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ab4a998fbf30629f886209458c39260af8334fb1bd7a91e103566b8a92a6c5e4
MD5 4fe50c17f5c12935f0b56bdf1f5a744c
BLAKE2b-256 8f29b633533e1dde64ed4bee9dfa216aff75f808a507cba3528bdfc8b5a8db65

See more details on using hashes here.

Supported by

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