Skip to content

Add knowledge-gradient and noisy-EI acquisition functions#54

Merged
MarcusMNoack merged 2 commits into
masterfrom
feature/kg-nei-acquisition
Jul 24, 2026
Merged

Add knowledge-gradient and noisy-EI acquisition functions#54
MarcusMNoack merged 2 commits into
masterfrom
feature/kg-nei-acquisition

Conversation

@MarcusMNoack

Copy link
Copy Markdown
Collaborator

Two lookahead optimization acquisitions, available as built-in strings for both single-task (GPOptimizer) and multi-task (fvGPOptimizer) decision-making:

  • "knowledge gradient": expected increase in the maximum of the posterior mean after a fantasized measurement (KGCP scheme; reference set = data points plus the candidate). The correlated-KG expectation E[max_i a_i + b_i Z] is computed exactly via the upper envelope of lines (Frazier, Powell & Dayanik 2009), validated against Monte Carlo.
  • "noisy expected improvement": EI averaged over the posterior of the incumbent, making it robust to observation noise (Letham et al. 2019). Monte-Carlo over posterior samples of the objective at the observed points, using common random numbers so the score is smooth for the acquisition optimizer.

For multi-task GPs both act on the task-summed objective sum_t f(x, t), matching how the existing multi-task expected improvement / ucb scalarize the outputs. The scalarized cross-covariance is taken from posterior_covariance()["S_flat"] using the task-major (k = point + Npts*task) product-space ordering.

Both are tunable through the constructor args dict (reference-set size, seed, and MC sample count for NEI). Wired into evaluate_gp_acquisition_function on both branches, the ask() docstring, tests (single and multi-task), and the acquisition-functions skill.

Two lookahead optimization acquisitions, available as built-in strings for both
single-task (GPOptimizer) and multi-task (fvGPOptimizer) decision-making:

- "knowledge gradient": expected increase in the maximum of the posterior mean
  after a fantasized measurement (KGCP scheme; reference set = data points plus
  the candidate). The correlated-KG expectation E[max_i a_i + b_i Z] is computed
  exactly via the upper envelope of lines (Frazier, Powell & Dayanik 2009),
  validated against Monte Carlo.
- "noisy expected improvement": EI averaged over the posterior of the incumbent,
  making it robust to observation noise (Letham et al. 2019). Monte-Carlo over
  posterior samples of the objective at the observed points, using common random
  numbers so the score is smooth for the acquisition optimizer.

For multi-task GPs both act on the task-summed objective sum_t f(x, t), matching
how the existing multi-task expected improvement / ucb scalarize the outputs. The
scalarized cross-covariance is taken from posterior_covariance()["S_flat"] using
the task-major (k = point + Npts*task) product-space ordering.

Both are tunable through the constructor args dict (reference-set size, seed, and
MC sample count for NEI). Wired into evaluate_gp_acquisition_function on both
branches, the ask() docstring, tests (single and multi-task), and the
acquisition-functions skill.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.12598% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.05%. Comparing base (b5e9bd2) to head (78f4d3c).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
gpcam/surrogate_model.py 91.30% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #54      +/-   ##
==========================================
+ Coverage   89.74%   90.05%   +0.30%     
==========================================
  Files           9        9              
  Lines         819      945     +126     
==========================================
+ Hits          735      851     +116     
- Misses         84       94      +10     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…ti-task skills

The acquisition-functions skill already documents both new acquisitions; this
surfaces them where a scientist actually picks one:

- experiment-designer: acquisition decision row + template comment now point to
  "noisy expected improvement" and "knowledge gradient" for noisy/lookahead
  optimization
- multi-task-advanced: note that EI/KG/noisy-EI work multi-task on the
  task-summed objective

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@MarcusMNoack
MarcusMNoack merged commit 3d576fa into master Jul 24, 2026
5 checks passed
@MarcusMNoack
MarcusMNoack deleted the feature/kg-nei-acquisition branch July 24, 2026 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant