BiFidelityActiveLearningGPDecision

Perform active learning decision making in bi-fidelity modeling.

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.

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]
  [sub_lf]
    type = SamplerFullSolveMultiApp
    sampler = mc
    input_files = 'sub_lf.i'
  []
  [sub]
    type = SamplerFullSolveMultiApp
    sampler = mc
    input_files = 'sub.i'
    mode = batch-reset
    should_run_reporter = conditional/need_sample
    execute_on = TIMESTEP_END
  []
[]
(contrib/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]
  [sub]
    type = SamplerParameterTransfer
    to_multi_app = sub
    sampler = mc
    parameters = 'Materials/conductivity/prop_values Kernels/source/value BCs/right/value'
    check_multiapp_execute_on = false
  []
  [sub_lf]
    type = SamplerParameterTransfer
    to_multi_app = sub_lf
    sampler = mc
    parameters = 'Materials/conductivity/prop_values Kernels/source/value BCs/right/value'
    check_multiapp_execute_on = false
  []
  [reporter_transfer_lf]
    type = SamplerReporterTransfer
    from_reporter = 'avg/value'
    stochastic_reporter = 'constant'
    from_multi_app = sub_lf
    sampler = mc
  []
  [reporter_transfer]
    type = SamplerReporterTransfer
    from_reporter = 'avg/value'
    stochastic_reporter = 'conditional'
    from_multi_app = sub
    sampler = mc
  []
[]
(contrib/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]
  [constant]
    type = StochasticReporter
  []
  [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
  []
[]
(contrib/moose/modules/stochastic_tools/test/tests/reporters/BFActiveLearning/main_adam.i)

Input Parameters

  • al_gpActive learning GP trainer.

    C++ Type:UserObjectName

    Unit:(no unit assumed)

    Controllable:No

    Description:Active learning GP trainer.

  • gp_evaluatorEvaluate the trained GP.

    C++ Type:UserObjectName

    Unit:(no unit assumed)

    Controllable:No

    Description:Evaluate the trained GP.

  • learning_functionThe learning function for active learning.

    C++ Type:MooseEnum

    Unit:(no unit assumed)

    Options:Ufunction, COV

    Controllable:No

    Description:The learning function for active learning.

  • learning_function_thresholdThe learning function threshold.

    C++ Type:double

    Unit:(no unit assumed)

    Controllable:No

    Description:The learning function threshold.

  • n_trainNumber of training steps.

    C++ Type:int

    Unit:(no unit assumed)

    Controllable:No

    Description:Number of training steps.

  • outputs_lfValue of the LF model output from the SubApp.

    C++ Type:ReporterName

    Unit:(no unit assumed)

    Controllable:No

    Description:Value of the LF model output from the SubApp.

  • samplerThe sampler object.

    C++ Type:SamplerName

    Unit:(no unit assumed)

    Controllable:No

    Description:The sampler object.

Required Parameters

  • execute_onTIMESTEP_ENDThe 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.

    Default:TIMESTEP_END

    C++ Type:ExecFlagEnum

    Unit:(no unit assumed)

    Options:NONE, INITIAL, LINEAR, NONLINEAR_CONVERGENCE, NONLINEAR, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM

    Controllable:No

    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.

  • flag_sampleflag_sampleFlag samples.

    Default:flag_sample

    C++ Type:ReporterValueName

    Unit:(no unit assumed)

    Controllable:No

    Description:Flag samples.

  • gp_meangp_meanThe GP mean prediction.

    Default:gp_mean

    C++ Type:ReporterValueName

    Unit:(no unit assumed)

    Controllable:No

    Description:The GP mean prediction.

  • gp_stdgp_stdThe GP standard deviation.

    Default:gp_std

    C++ Type:ReporterValueName

    Unit:(no unit assumed)

    Controllable:No

    Description:The GP standard deviation.

  • inputsinputsThe inputs.

    Default:inputs

    C++ Type:ReporterValueName

    Unit:(no unit assumed)

    Controllable:No

    Description:The inputs.

  • learning_function_parameter1.79769e+308The learning function parameter.

    Default:1.79769e+308

    C++ Type:double

    Unit:(no unit assumed)

    Controllable:No

    Description:The learning function parameter.

  • lf_correctedlf_correctedGP-corrected LF prediciton.

    Default:lf_corrected

    C++ Type:ReporterValueName

    Unit:(no unit assumed)

    Controllable:No

    Description:GP-corrected LF prediciton.

  • parallel_typeDISTRIBUTEDThis parameter will determine how the stochastic data is gathered. It is common for outputting purposes that this parameter be set to ROOT, otherwise, many files will be produced showing the values on each processor. However, if there are lot of samples, gathering on root may be memory restrictive.

    Default:DISTRIBUTED

    C++ Type:MooseEnum

    Unit:(no unit assumed)

    Options:DISTRIBUTED, ROOT

    Controllable:No

    Description:This parameter will determine how the stochastic data is gathered. It is common for outputting purposes that this parameter be set to ROOT, otherwise, many files will be produced showing the values on each processor. However, if there are lot of samples, gathering on root may be memory restrictive.

  • prop_getter_suffixAn optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.

    C++ Type:MaterialPropertyName

    Unit:(no unit assumed)

    Controllable:No

    Description:An optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.

  • use_interpolated_stateFalseFor the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.

    Default:False

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:For the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.

Optional Parameters

  • allow_duplicate_execution_on_initialFalseIn the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).

    Default:False

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:In the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).

  • control_tagsAdds user-defined labels for accessing object parameters via control logic.

    C++ Type:std::vector<std::string>

    Unit:(no unit assumed)

    Controllable:No

    Description:Adds user-defined labels for accessing object parameters via control logic.

  • enableTrueSet the enabled status of the MooseObject.

    Default:True

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:Yes

    Description:Set the enabled status of the MooseObject.

  • execution_order_group0Execution order groups are executed in increasing order (e.g., the lowest number is executed first). Note that negative group numbers may be used to execute groups before the default (0) group. Please refer to the user object documentation for ordering of user object execution within a group.

    Default:0

    C++ Type:int

    Unit:(no unit assumed)

    Controllable:No

    Description:Execution order groups are executed in increasing order (e.g., the lowest number is executed first). Note that negative group numbers may be used to execute groups before the default (0) group. Please refer to the user object documentation for ordering of user object execution within a group.

  • force_postauxFalseForces the UserObject to be executed in POSTAUX

    Default:False

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:Forces the UserObject to be executed in POSTAUX

  • force_preauxFalseForces the UserObject to be executed in PREAUX

    Default:False

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:Forces the UserObject to be executed in PREAUX

  • force_preicFalseForces the UserObject to be executed in PREIC during initial setup

    Default:False

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:Forces the UserObject to be executed in PREIC during initial setup

  • outputsVector of output names where you would like to restrict the output of variables(s) associated with this object

    C++ Type:std::vector<OutputName>

    Unit:(no unit assumed)

    Controllable:No

    Description:Vector of output names where you would like to restrict the output of variables(s) associated with this object

  • use_displaced_meshFalseWhether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.

    Default:False

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:Whether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.

Advanced Parameters