19 params.
addClassDescription(
"Monte Carlo Sampler for active learning with surrogate model.");
21 "The number of full model evaluations in the batch.");
24 "The distribution names to be sampled, the number of distributions provided defines the "
25 "number of columns per matrix.");
27 "Flag samples if the surrogate prediction was inadequate.");
31 "Initialize a certain number of random seeds. Change from the default only if you have to.");
35 "Number of samples to use (the total number of steps taken will be equal to this number + "
36 "the number of re-training steps).");
42 _flag_sample(getReporterValue<
std::vector<bool>>(
"flag_sample")),
43 _step(getCheckedPointerParam<
FEProblemBase *>(
"_fe_problem_base")->timeStep()),
44 _num_batch(getParam<dof_id_type>(
"num_batch")),
45 _num_samples(getParam<
int>(
"num_samples"))
47 for (
const DistributionName &
name : getParam<std::vector<DistributionName>>(
"distributions"))
60 mooseError(
"Internal bug: the adaptive sampling is supposed to be completed but another sample "
61 "has been requested.");
registerMooseObject("StochasticToolsApp", ActiveLearningMonteCarloSampler)
void ErrorVector unsigned int
A class used to perform Monte Carlo Sampling with active learning.
std::vector< std::vector< Real > > _inputs_sto
Storage for previously accepted samples by the decision reporter system.
std::vector< Distribution const * > _distributions
Storage for distribution objects to be utilized.
const int & _step
Track the current step of the main App.
bool _is_sampling_completed
True if the sampling is completed.
int _retraining_steps
Number of retraining performed.
const unsigned int _num_batch
The maximum number of GP fails.
const int & _num_samples
Number of samples requested.
virtual void executeSetUp() override
Gather all the samples once per timestep.
ActiveLearningMonteCarloSampler(const InputParameters ¶meters)
static InputParameters validParams()
std::vector< std::vector< Real > > _inputs_gp_fails
Store the input params for which the GP fails.
const std::vector< bool > & _flag_sample
Flag samples if the surrogate prediction was inadequate.
virtual Real computeSample(dof_id_type row_index, dof_id_type col_index) override
Return the sample for the given row and column.
const Distribution & getDistributionByName(const DistributionName &name) const
const std::string & name() const
void mooseError(Args &&... args) const
void setNumberOfCols(dof_id_type n_cols)
Real getRand(std::size_t n, unsigned int index=0) const
void setAutoAdvanceGenerators(const bool state)
static InputParameters validParams()
void setNumberOfRows(dof_id_type n_rows)
void setNumberOfRandomSeeds(std::size_t number)