romtools.workflows.inverse.vi.sample_reuse#

Importance-sampling sample reuse for VI and MFVI.

This module implements an opt-in ABRIS-style reuse layer around ROMTools’ existing VI drivers. Expensive high-fidelity evaluations are cached in batches together with the variational distribution that generated them. A bounded inner sampling loop adds fresh batches until the reuse diagnostics pass, then forms the update from the complete retained archive.

Functions

make_controller(config, call_args, *[, ...])

Create a private evaluator for this run, leaving module globals untouched.

Classes

VISampleReuseConfig([enabled, ...])

Configuration for ABRIS-style reuse of previous VI samples.

class romtools.workflows.inverse.vi.sample_reuse.VISampleReuseConfig(enabled=True, history_batches=10, ess_threshold=None, use_score_diagnostic=True, score_error_scale=1.0, periodic_refresh=100, use_hessian_score_diagnostic=True, hessian_score_error_scale=2.0, hessian_relative_standard_error_threshold=0.25)[source]#

Bases: object

Configuration for ABRIS-style reuse of previous VI samples.

history_batches controls both the maximum moving-window size and the maximum number of fresh batches allowed in one state evaluation. During zero-based iteration i, both limits grow as min(history_batches, i + 1). Every returned update is formed from the retained archive, including evaluations that sampled fresh batches.

Parameters:
  • enabled (bool)

  • history_batches (int)

  • ess_threshold (float | None)

  • use_score_diagnostic (bool)

  • score_error_scale (float)

  • periodic_refresh (int | None)

  • use_hessian_score_diagnostic (bool)

  • hessian_score_error_scale (float)

  • hessian_relative_standard_error_threshold (float | None)

romtools.workflows.inverse.vi.sample_reuse.make_controller(config, call_args, *, multifidelity=False)[source]#

Create a private evaluator for this run, leaving module globals untouched.