9#ifdef MOOSE_LIBTORCH_ENABLED
20 params.
addClassDescription(
"Perform active learning decision making in bi-fidelity modeling.");
23 "Value of the LF model output from the SubApp.");
24 params.
addParam<ReporterValueName>(
"lf_corrected",
"lf_corrected",
"GP-corrected LF prediciton.");
31 _sampler(getSampler(
"sampler")),
33 _lf_corrected(declareValue<
std::vector<Real>>(
"lf_corrected",
34 std::vector<Real>(sampler().getNumberOfRows()))),
35 _local_comm(_sampler.getLocalComm())
42 for (dof_id_type i = 0; i <
_inputs.size(); ++i)
86 dof_id_type global_ind,
registerMooseObject("StochasticToolsApp", BiFidelityActiveLearningGPDecision)
const ReporterMode REPORTER_MODE_DISTRIBUTED
std::vector< bool > & _flag_sample
Flag samples when the GP fails.
const int _n_train
Number of initial training points for GP.
const std::vector< std::vector< Real > > & _inputs_global
Reference to global input data requested from base class.
std::vector< Real > & _gp_std
Broadcast the GP standard deviation to JSON.
const std::vector< Real > & _outputs_global
Reference to global output data requested from base class.
bool _decision
GP pass/fail decision.
std::vector< Real > _outputs_batch
Store all the outputs used for training.
const SurrogateModel & _gp_eval
The GP evaluator object that permits re-evaluations.
virtual void setupData(const std::vector< std::vector< Real > > &inputs, const std::vector< Real > &outputs)
This sets up data for re-training the GP.
static InputParameters validParams()
std::vector< std::vector< Real > > & _inputs
Storage for the input vectors to be transferred to the output file.
std::vector< std::vector< Real > > _inputs_batch
Store all the input vectors used for training.
const ActiveLearningGaussianProcess & _al_gp
The active learning GP trainer that permits re-training.
std::vector< Real > & _gp_mean
Broadcast the GP mean prediciton to JSON.
bool learningFunction(const Real &gp_mean, const Real &gp_std) const
This method evaluates the active learning acquisition function and returns bool that indicates whethe...
virtual void reTrain(const std::vector< std::vector< Real > > &inputs, const std::vector< Real > &outputs) const final
A class for performing active learning decision making in bi-fidelity modeling.
BiFidelityActiveLearningGPDecision(const InputParameters ¶meters)
std::vector< Real > _outputs_lf_batch
Store all the outputs used for training from the LF model.
std::vector< Real > & _lf_corrected
Broadcast the GP-corrected LF prediciton to JSON.
const std::vector< Real > & _outputs_lf
Store all the outputs used for training from the LF model.
virtual bool facilitateDecision() override
This makes decisions whether to call the full model or not based on GP prediction and uncertainty.
virtual void preNeedSample() override
This is where most of the computations happen:
libMesh::Parallel::Communicator & _local_comm
Communicator that was split based on samples that have rows.
static InputParameters validParams()
virtual bool needSample(const std::vector< Real > &row, dof_id_type local_ind, dof_id_type global_ind, Real &val) override
Based on the computations in preNeedSample, the decision to get more data is passed and results from ...
virtual Real evaluate(const std::vector< Real > &x) const
Evaluate surrogate model given a row of parameters.
void allgather(const T &send_data, std::vector< T, A > &recv_data) const