https://mooseframework.inl.gov
ActiveLearningMonteCarloSampler.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
12 #include "Sampler.h"
13 
18 {
19 public:
21 
23 
27  virtual bool isAdaptiveSamplingCompleted() const override { return _is_sampling_completed; }
28 
29 protected:
31  virtual void sampleSetUp(const Sampler::SampleMode mode) override;
33  virtual Real computeSample(dof_id_type row_index, dof_id_type col_index) override;
34 
36  std::vector<Distribution const *> _distributions;
37 
39  const std::vector<bool> & _flag_sample;
40 
42  bool _is_sampling_completed = false;
43 
44 private:
46  const int & _step;
47 
49  const unsigned int _num_batch;
50 
53 
55  const int & _num_samples;
56 
59 
61  std::vector<std::vector<Real>> _inputs_sto;
62 
64  std::vector<std::vector<Real>> _inputs_gp_fails;
65 };
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.
const std::vector< bool > & _flag_sample
Flag samples if the surrogate prediction was inadequate.
int _retraining_steps
Number of retraining performed.
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 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.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual bool isAdaptiveSamplingCompleted() const override
Returns true if the adaptive sampling is completed.
const InputParameters & parameters() const
int _check_step
Ensure that the sampler proceeds in a sequential fashion.
const unsigned int _num_batch
The maximum number of GP fails.
virtual void sampleSetUp(const Sampler::SampleMode mode) override
Gather all the samples.
uint8_t dof_id_type
ActiveLearningMonteCarloSampler(const InputParameters &parameters)