https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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{
19public:
21
23
27 virtual bool isAdaptiveSamplingCompleted() const override { return _is_sampling_completed; }
28
29protected:
31 virtual void executeSetUp() 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
43
44private:
46 const int & _step;
47
49 const unsigned int _num_batch;
50
52 const int & _num_samples;
53
56
58 std::vector<std::vector<Real>> _inputs_sto;
59
61 std::vector<std::vector<Real>> _inputs_gp_fails;
62};
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.
virtual bool isAdaptiveSamplingCompleted() const override
Returns true if the adaptive sampling is completed.
const int & _num_samples
Number of samples requested.
virtual void executeSetUp() override
Gather all the samples once per timestep.
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 InputParameters & parameters() const