romtools.workflows.multifidelity#
Fixed-allocation random adaptive training for ordered multifidelity QoI models.
This first workflow intentionally keeps fidelity allocation fixed. All model evaluations use the existing blocking/nonblocking execution abstraction.
Functions
|
Build a multifidelity surrogate after each randomized sampling round. |
Classes
|
|
|
Executable model and fixed nominal cost, ordered low to high. |
|
K-fold CV of the highest fidelity, retaining all lower-level data. |
|
Inputs to a custom validation strategy; training data are copies. |
- class romtools.workflows.multifidelity.AdaptiveMultiFidelityResult(rom_model: 'QoiModel', training_data: 'tuple[FidelityData, ...]', validation_errors: 'np.ndarray', sample_counts: 'np.ndarray', total_cost: 'float', converged: 'bool', termination_reason: 'str')[source]#
Bases:
object- Parameters:
rom_model (QoiModel)
training_data (tuple[FidelityData, ...])
validation_errors (ndarray)
sample_counts (ndarray)
total_cost (float)
converged (bool)
termination_reason (str)
- class romtools.workflows.multifidelity.FidelityLevel(model, name, cost=1.0)[source]#
Bases:
objectExecutable model and fixed nominal cost, ordered low to high.
- Parameters:
model (QoiModel)
name (str)
cost (float)
- class romtools.workflows.multifidelity.MultiFidelityKFoldValidation(num_folds=5)[source]#
Bases:
objectK-fold CV of the highest fidelity, retaining all lower-level data.
Lower-fidelity data at held-out high-fidelity locations remain available: CV assesses HF prediction when inexpensive evaluations are known. The result is the maximum per-sample held-out relative L2 error, consistent with ROMtools’ existing KFoldValidation.
- Parameters:
num_folds (int)
- class romtools.workflows.multifidelity.MultiFidelityValidationContext(rom_model, rom_model_builder, training_data, parameter_names, iteration, validation_directory, random_seed, error_functor)[source]#
Bases:
objectInputs to a custom validation strategy; training data are copies.
- Parameters:
rom_model (QoiModel)
rom_model_builder (object)
training_data (tuple[FidelityData, ...])
parameter_names (tuple[str, ...])
iteration (int)
validation_directory (str)
random_seed (int)
error_functor (Callable)
- romtools.workflows.multifidelity.run_adaptive_multifidelity(fidelities, surrogate_builder, parameter_space, absolute_work_dir, tolerance, initial_samples, batch_sizes, *, adaptive_sampling_strategy='random', pair_fidelity_samples=True, validation_strategy=None, error_functor=<function relative_l2_error>, max_iterations=20, max_total_cost=None, max_concurrent_fom_runs=1, random_seed=1)[source]#
Build a multifidelity surrogate after each randomized sampling round.
An iteration always schedules the requested counts at every fidelity. Iteration zero uses initial_samples; subsequent rounds use batch_sizes. With pairing, every higher-fidelity location is sampled at all lower levels and per-level counts must be nonincreasing. ParameterSpace controls the underlying random sampling distribution. Costs are fixed user inputs; incomplete rounds are not automatically retried or restarted.
- Parameters:
fidelities (Sequence[FidelityLevel])
parameter_space (ParameterSpace)
absolute_work_dir (str)
tolerance (float)
initial_samples (Sequence[int])
batch_sizes (Sequence[int])
adaptive_sampling_strategy (str)
pair_fidelity_samples (bool)
validation_strategy (Callable | None)
error_functor (Callable)
max_iterations (int)
max_total_cost (float | None)
max_concurrent_fom_runs (int)
random_seed (int)
- Return type: