https://mooseframework.inl.gov
GenericActiveLearningSampler.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 #include "TransientInterface.h"
14 #include "Distribution.h"
15 
20 {
21 public:
23 
25 
29  const std::vector<std::vector<Real>> & getSampleTries() const;
30 
35 
36 protected:
38  virtual void executeSetUp() override;
40  virtual Real computeSample(dof_id_type row_index, dof_id_type col_index) override;
41 
43  std::vector<Distribution const *> _distributions;
44 
46  const unsigned int _num_parallel_proposals;
47 
49  const std::vector<unsigned int> & _sorted_indices;
50 
52  const std::vector<Real> & _initial_values;
53 
55  std::vector<std::vector<Real>> _new_samples;
56 
57 private:
59  const unsigned int _num_tries;
60 
62  std::vector<std::vector<Real>> _inputs_all;
63 };
const std::vector< unsigned int > & _sorted_indices
The selected sample indices to evaluate the subApp.
const std::vector< std::vector< Real > > & getSampleTries() const
Return random samples for the GP to try in the reporter class.
const InputParameters & parameters() const
virtual void executeSetUp() override
Gather all the samples.
const std::vector< Real > & _initial_values
Initial values of the input params to get the MCMC scheme started.
GenericActiveLearningSampler(const InputParameters &parameters)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const unsigned int _num_parallel_proposals
Number of parallel proposals to be made and subApps to be executed.
A generic sampler to support parallel active learning.
dof_id_type getNumParallelProposals() const
Return the number of parallel proposals.
std::vector< std::vector< Real > > _new_samples
Vectors of new proposed samples.
std::vector< std::vector< Real > > _inputs_all
Storage for all the proposed samples.
virtual Real computeSample(dof_id_type row_index, dof_id_type col_index) override
Return the sample for the given row and column.
const unsigned int _num_tries
Number of samples to propose in each iteration (not all are sent for subApp evals) ...
uint8_t dof_id_type
std::vector< Distribution const * > _distributions
Storage for distribution objects to be utilized.