20 "A reporter to support parallel active learning for Bayesian UQ tasks.");
21 params.
addRequiredParam<std::vector<UserObjectName>>(
"likelihoods",
"Names of likelihoods.");
23 "noise",
"noise",
"Name of the model noise term to pass to Likelihoods object.");
30 _new_var_samples(_al_sampler.getVarSamples()),
31 _var_prior(_al_sampler.getVarPrior()),
32 _var_test(_al_sampler.getVarSampleTries()),
33 _noise(declareValue<
Real>(
"noise"))
36 for (
const UserObjectName &
name :
getParam<std::vector<UserObjectName>>(
"likelihoods"))
58 std::vector<Real> tmp;
64 for (
unsigned int i = 0; i <
_props; ++i)
67 tmp[
j] = data_in(i,
j);
83 for (
unsigned int i = 0; i <
_props; ++i)
100 Real convergence_value = 0.0;
101 unsigned int num_valid = 0;
102 for (
unsigned int ii = 0; ii <
_props; ++ii)
110 convergence_value = std::sqrt(convergence_value) / num_valid;
111 return convergence_value;
117 std::vector<Real> tmp;
virtual void setupGPData(const std::vector< Real > &data_out, const DenseMatrix< Real > &data_in) override
Sets up the training data for the GP model.
A generic reporter to support parallel active learning: re-trains GP and picks the next best batch...
std::vector< std::vector< Real > > _inputs_test_modified
Storage for all the modified proposed samples to test the GP model.
std::vector< Real > _log_likelihood
Storage for the computed log-likelihood values in each iteration of active learning.
Fast Bayesian inference with the parallel active learning (partly inspired from El Gammal et al...
dof_id_type getNumberOfConfigValues() const
Return the number of configuration parameters.
std::vector< std::vector< Real > > _gp_inputs
Storage for the GP re-training inputs.
virtual void evaluateGPTest() override
Evaluate the GP on all the test samples sent by the Sampler.
BayesianActiveLearner(const InputParameters ¶meters)
dof_id_type getNumberOfConfigParams() const
Return the number of configuration parameters.
const T & getParam(const std::string &name) const
virtual Real computeConvergenceValue() override
Computes the convergence value during active learning.
std::vector< Real > _eval_outputs_current
The GP outputs from the current iteration before re-training (to evaluate convergence) ...
std::vector< const LikelihoodFunctionBase * > _likelihoods
Storage for the likelihood objects to be utilized.
registerMooseObject("StochasticToolsApp", BayesianActiveLearner)
const SurrogateModel & _gp_eval
The GP evaluator object that permits re-evaluations.
void computeLogLikelihood(const std::vector< Real > &data_out)
Sets up the training data for the GP model for Bayesian UQ tasks.
std::vector< Real > _length_scales
Storage for the length scales after the GP training.
static InputParameters validParams()
dof_id_type _props
Storage for the number of parallel proposals.
unsigned int _n_dim
The input dimension for GP, equal to Sampler columns.
const Distribution * _var_prior
Storage for the prior over the variance.
Real & _noise
Model noise term to pass to Likelihoods object.
const std::string & name() const
A reporter to support parallel active learning for Bayesian UQ tasks.
const std::vector< std::vector< Real > > & _inputs_test
Storage for all the proposed samples to test the GP model.
const std::vector< Real > & _new_var_samples
Storage for new proposed variance samples.
unsigned int _n_dim_plus_var
The input dimension for GP for Bayesian problems with var, equal to Sampler columns + 1...
static InputParameters validParams()
dof_id_type _num_confg_params
Storage for the number of experimental configuration parameters.
virtual Real evaluate(const std::vector< Real > &x) const
Evaluate surrogate model given a row of parameters.
static InputParameters validParams()
virtual void includeAdditionalInputs() override
Include additional inputs before evaluating the acquisition function.
dof_id_type _num_confg_values
Storage for the number of experimental configuration values.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
LikelihoodFunctionBase * getLikelihoodFunctionByName(const UserObjectName &name) const
Lookup a LikelihoodFunction object by name and return pointer.
std::vector< Real > _gp_outputs
Storage for the GP re-training outputs.
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
std::vector< Real > _gp_std_test
Outputs of GP model standard deviation for the test samples.
BayesianActiveLearningSampler & _al_sampler
The base sampler.
const std::vector< Real > & _var_test
Storage for all the proposed variance samples to test the GP model.
dof_id_type getNumberOfCols() const
std::vector< Real > _gp_outputs_test
Outputs of GP model for the test samples.