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()),
45 _check_step(
std::numeric_limits<
int>::
min()),
46 _num_samples(getParam<
int>(
"num_samples"))
48 for (
const DistributionName &
name :
getParam<std::vector<DistributionName>>(
"distributions"))
64 mooseError(
"Internal bug: the adaptive sampling is supposed to be completed but another sample " 65 "has been requested.");
void setNumberOfRows(dof_id_type n_rows)
A class used to perform Monte Carlo Sampling with active learning.
virtual Real computeSample(dof_id_type row_index, dof_id_type col_index) override
Return the sample for the given row and column.
static InputParameters validParams()
const std::vector< bool > & _flag_sample
Flag samples if the surrogate prediction was inadequate.
int _retraining_steps
Number of retraining performed.
Real getRand(unsigned int index=0)
virtual const std::string & name() const
const int & _num_samples
Number of samples requested.
std::vector< std::vector< Real > > _inputs_gp_fails
Store the input params for which the GP fails.
std::vector< Distribution const * > _distributions
Storage for distribution objects to be utilized.
const T & getParam(const std::string &name) const
const int & _step
Track the current step of the main App.
std::vector< std::vector< Real > > _inputs_sto
Storage for previously accepted samples by the decision reporter system.
bool _is_sampling_completed
True if the sampling is completed.
const Distribution & getDistributionByName(const DistributionName &name) const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void setNumberOfCols(dof_id_type n_cols)
void mooseError(Args &&... args) const
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
static InputParameters validParams()
int _check_step
Ensure that the sampler proceeds in a sequential fashion.
const unsigned int _num_batch
The maximum number of GP fails.
auto min(const L &left, const R &right)
registerMooseObject("StochasticToolsApp", ActiveLearningMonteCarloSampler)
void ErrorVector unsigned int
virtual void sampleSetUp(const Sampler::SampleMode mode) override
Gather all the samples.
ActiveLearningMonteCarloSampler(const InputParameters ¶meters)
void setNumberOfRandomSeeds(std::size_t number)