https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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{
21public:
23
25
29 const std::vector<std::vector<Real>> & getSampleTries() const;
30
34 dof_id_type getNumParallelProposals() const { return _num_parallel_proposals; }
35
36protected:
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
57private:
59 const unsigned int _num_tries;
60
62 std::vector<std::vector<Real>> _inputs_all;
63};
A generic sampler to support parallel active learning.
std::vector< Distribution const * > _distributions
Storage for distribution objects to be utilized.
const unsigned int _num_parallel_proposals
Number of parallel proposals to be made and subApps to be executed.
const std::vector< Real > & _initial_values
Initial values of the input params to get the MCMC scheme started.
virtual Real computeSample(dof_id_type row_index, dof_id_type col_index) override
Return the sample for the given row and column.
dof_id_type getNumParallelProposals() const
Return the number of parallel proposals.
std::vector< std::vector< Real > > _new_samples
Vectors of new proposed samples.
const unsigned int _num_tries
Number of samples to propose in each iteration (not all are sent for subApp evals)
std::vector< std::vector< Real > > _inputs_all
Storage for all the proposed samples.
const std::vector< std::vector< Real > > & getSampleTries() const
Return random samples for the GP to try in the reporter class.
virtual void executeSetUp() override
Gather all the samples.
const std::vector< unsigned int > & _sorted_indices
The selected sample indices to evaluate the subApp.
const InputParameters & parameters() const