BiFidelityActiveLearningGPDecision

Description

The BiFidelityActiveLearningGPDecision class has a very similar behavior as the ActiveLearningGPDecision class. The figure below demonstrates the behavior of active learning with bi-fidelity modeling using Monte Carlo sampling with ActiveLearningMonteCarloSampler. Instead of relying on a Gaussian Process (GP) prediction by default, a low-fidelity (LF) model prediction that is cheap to evaluate is used. Then, a GP correction is added to the LF model prediction to improve its quality and also quantify the LF prediction uncertainty. The GP itself is trained on the differences between the high-fidelity (HF) and LF model predictions. If the GP-corrected LF model prediction is not acceptable based on the uncertainty information, only then, the expensive HF model is called. Otherwise, the GP-corrected LF model predictions are used in a Monte Carlo sampler. Moreover, the calls to both the LF and HF model can be parallelized with the num_batch option in ActiveLearningMonteCarloSampler. When set to 1, it represents a serial Monte Carlo sampling.

Schematic of the bi-fidelity active learning process in MOOSE.

Figure 1: Schematic of the bi-fidelity active learning process in MOOSE.

Input file syntax

The input file syntax is largely similar to GP-based active learning described in ActiveLearningGPDecision. There are three fundamental differences for leveraging bi-fidelity modeling.

First, the MultiApps block needs to have two subApps, one for the LF model and one for the HF model. This is shown in the listing below.

[MultiApps<<<{"href": "../../syntax/MultiApps/index.html"}>>>]
  [sub_lf]
    type = SamplerFullSolveMultiApp<<<{"description": "Creates a full-solve type sub-application for each row of each Sampler matrix.", "href": "../multiapps/SamplerFullSolveMultiApp.html"}>>>
    sampler<<<{"description": "The Sampler object to utilize for creating MultiApps."}>>> = mc
    input_files<<<{"description": "The input file for each App.  If this parameter only contains one input file it will be used for all of the Apps.  When using 'positions_from_file' it is also admissable to provide one input_file per file."}>>> = 'sub_lf.i'
  []
  [sub]
    type = SamplerFullSolveMultiApp<<<{"description": "Creates a full-solve type sub-application for each row of each Sampler matrix.", "href": "../multiapps/SamplerFullSolveMultiApp.html"}>>>
    sampler<<<{"description": "The Sampler object to utilize for creating MultiApps."}>>> = mc
    input_files<<<{"description": "The input file for each App.  If this parameter only contains one input file it will be used for all of the Apps.  When using 'positions_from_file' it is also admissable to provide one input_file per file."}>>> = 'sub.i'
    mode<<<{"description": "The operation mode, 'normal' creates one sub-application for each row in the Sampler and 'batch-reset' and 'batch-restore' creates N sub-applications, where N is the minimum of 'num_rows' in the Sampler and floor(number of processes / min_procs_per_app). To run the rows in the Sampler, 'batch-reset' will destroy and re-create sub-apps as needed, whereas the 'batch-restore' will backup and restore sub-apps to the initial state prior to execution, without destruction."}>>> = batch-reset
    should_run_reporter<<<{"description": "Vector reporter value determining whether a certain multiapp should be run with this multiapp. This only works in batch-reset or batch-restore mode."}>>> = conditional/need_sample
    execute_on<<<{"description": "The list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html."}>>> = TIMESTEP_END
  []
[]
(moose/modules/stochastic_tools/test/tests/reporters/BFActiveLearning/main_adam.i)

Second, the Transfers block needs to transfer the stochastic parameters to both the LF and HF models. Also, the outputs need to be transferred back to the mainApp from both the LF and HF models. This is shown in the listing below.

[Transfers<<<{"href": "../../syntax/Transfers/index.html"}>>>]
  [sub]
    type = SamplerParameterTransfer<<<{"description": "Copies Sampler data to a SamplerReceiver object.", "href": "../transfers/SamplerParameterTransfer.html"}>>>
    to_multi_app<<<{"description": "The name of the MultiApp to transfer the data to"}>>> = sub
    sampler<<<{"description": "A the Sampler object that Transfer is associated.."}>>> = mc
    parameters<<<{"description": "A list of parameters (on the sub application) to control with the Sampler data. The order of the parameters listed here should match the order of the items in the Sampler."}>>> = 'Materials/conductivity/prop_values Kernels/source/value BCs/right/value'
    check_multiapp_execute_on<<<{"description": "When false the check between the multiapp and transfer execute on flags is not performed."}>>> = false
  []
  [sub_lf]
    type = SamplerParameterTransfer<<<{"description": "Copies Sampler data to a SamplerReceiver object.", "href": "../transfers/SamplerParameterTransfer.html"}>>>
    to_multi_app<<<{"description": "The name of the MultiApp to transfer the data to"}>>> = sub_lf
    sampler<<<{"description": "A the Sampler object that Transfer is associated.."}>>> = mc
    parameters<<<{"description": "A list of parameters (on the sub application) to control with the Sampler data. The order of the parameters listed here should match the order of the items in the Sampler."}>>> = 'Materials/conductivity/prop_values Kernels/source/value BCs/right/value'
    check_multiapp_execute_on<<<{"description": "When false the check between the multiapp and transfer execute on flags is not performed."}>>> = false
  []
  [reporter_transfer_lf]
    type = SamplerReporterTransfer<<<{"description": "Transfers data from Reporters on the sub-application to a StochasticReporter on the main application.", "href": "../transfers/SamplerReporterTransfer.html"}>>>
    from_reporter<<<{"description": "The name(s) of the Reporter(s) on the sub-app to transfer from."}>>> = 'avg/value'
    stochastic_reporter<<<{"description": "The name of the StochasticReporter object to transfer values to."}>>> = 'constant'
    from_multi_app<<<{"description": "The name of the MultiApp to receive data from"}>>> = sub_lf
    sampler<<<{"description": "A the Sampler object that Transfer is associated.."}>>> = mc
  []
  [reporter_transfer]
    type = SamplerReporterTransfer<<<{"description": "Transfers data from Reporters on the sub-application to a StochasticReporter on the main application.", "href": "../transfers/SamplerReporterTransfer.html"}>>>
    from_reporter<<<{"description": "The name(s) of the Reporter(s) on the sub-app to transfer from."}>>> = 'avg/value'
    stochastic_reporter<<<{"description": "The name of the StochasticReporter object to transfer values to."}>>> = 'conditional'
    from_multi_app<<<{"description": "The name of the MultiApp to receive data from"}>>> = sub
    sampler<<<{"description": "A the Sampler object that Transfer is associated.."}>>> = mc
  []
[]
(moose/modules/stochastic_tools/test/tests/reporters/BFActiveLearning/main_adam.i)

Third, instead of relying on ActiveLearningGPDecision for evaluating the quality of the GP-corrected LF model prediction, we rely on BiFidelityActiveLearningGPDecision. This takes into account the LF model predictions, as shown in the listing below.

[Reporters<<<{"href": "../../syntax/Reporters/index.html"}>>>]
  [constant]
    type = StochasticReporter<<<{"description": "Storage container for stochastic simulation results coming from Reporters.", "href": "StochasticReporter.html"}>>>
  []
  [conditional]
    type = BiFidelityActiveLearningGPDecision
    sampler = mc
    parallel_type = ROOT
    execute_on = 'timestep_begin'
    flag_sample = 'flag_sample'
    inputs = 'inputs'
    gp_mean = 'gp_mean'
    gp_std = 'gp_std'
    n_train = 8
    al_gp = GP_al_trainer
    gp_evaluator = GP_eval
    learning_function = 'Ufunction'
    learning_function_parameter = 349.345
    learning_function_threshold = 2.0
    outputs_lf = constant/reporter_transfer_lf:avg:value
  []
[]
(moose/modules/stochastic_tools/test/tests/reporters/BFActiveLearning/main_adam.i)
warningwarning

The detailed documentation of this object is only available when Moose is compiled with Libtorch. For instructions on how to compile Moose with Libtorch, visit the general installation webpage or click here.