A class used to perform Adaptive Importance Sampling using a Markov Chain Monte Carlo algorithm. More...
#include <AdaptiveImportanceSampler.h>
Public Types | |
| enum | SampleMode { SampleMode::GLOBAL, SampleMode::LOCAL } |
| typedef DataFileName | DataFileParameterType |
Public Member Functions | |
| AdaptiveImportanceSampler (const InputParameters ¶meters) | |
| const std::vector< Real > & | getInitialValues () const |
| const int & | getNumSamplesTrain () const |
| const bool & | getUseAbsoluteValue () const |
| const Real & | getOutputLimit () const |
| const std::vector< Real > & | getImportanceVectorMean () const |
| const std::vector< Real > & | getImportanceVectorStd () const |
| const std::vector< const Distribution * > & | getDistributionNames () const |
| const Real & | getStdFactor () const |
| virtual bool | isAdaptiveSamplingCompleted () const override |
| Returns true if the adaptive sampling is completed. More... | |
| std::vector< Real > | getNextLocalRow () |
| dof_id_type | getNumberOfRows () const |
| dof_id_type | getNumberOfCols () const |
| dof_id_type | getNumberOfLocalRows () const |
| const LocalRankConfig & | getRankConfig (bool batch_mode) const |
| libMesh::Parallel::Communicator & | getLocalComm () |
| virtual bool | enabled () const |
| std::shared_ptr< MooseObject > | getSharedPtr () |
| std::shared_ptr< const MooseObject > | getSharedPtr () const |
| bool | isKokkosObject (IsKokkosObjectKey &&) const |
| MooseApp & | getMooseApp () const |
| const std::string & | type () const |
| const std::string & | name () const |
| std::string | typeAndName () const |
| MooseObjectParameterName | uniqueParameterName (const std::string ¶meter_name) const |
| MooseObjectName | uniqueName () const |
| const InputParameters & | parameters () const |
| const hit::Node * | getHitNode () const |
| bool | hasBase () const |
| const std::string & | getBase () const |
| const T & | getParam (const std::string &name) const |
| std::vector< std::pair< T1, T2 > > | getParam (const std::string ¶m1, const std::string ¶m2) const |
| const T * | queryParam (const std::string &name) const |
| const T & | getRenamedParam (const std::string &old_name, const std::string &new_name) const |
| T | getCheckedPointerParam (const std::string &name, const std::string &error_string="") const |
| bool | isParamValid (const std::string &name) const |
| bool | isParamSetByUser (const std::string &name) const |
| void | connectControllableParams (const std::string ¶meter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const |
| void | paramError (const std::string ¶m, Args... args) const |
| void | paramWarning (const std::string ¶m, Args... args) const |
| void | paramWarning (const std::string ¶m, Args... args) const |
| void | paramInfo (const std::string ¶m, Args... args) const |
| std::string | messagePrefix (const bool hit_prefix=true) const |
| std::string | errorPrefix (const std::string &) const |
| void | mooseError (Args &&... args) const |
| void | mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const |
| void | mooseErrorNonPrefixed (Args &&... args) const |
| void | mooseWarning (Args &&... args) const |
| void | mooseWarning (Args &&... args) const |
| void | mooseWarningNonPrefixed (Args &&... args) const |
| void | mooseWarningNonPrefixed (Args &&... args) const |
| void | mooseDeprecated (Args &&... args) const |
| void | mooseDeprecated (Args &&... args) const |
| void | mooseInfo (Args &&... args) const |
| void | callMooseError (std::string msg, const bool with_prefix, const hit::Node *node=nullptr) const |
| std::string | getDataFileName (const std::string ¶m) const |
| std::string | getDataFileNameByName (const std::string &relative_path) const |
| std::string | getDataFilePath (const std::string &relative_path) const |
| virtual void | initialSetup () |
| virtual void | timestepSetup () |
| virtual void | jacobianSetup () |
| virtual void | residualSetup () |
| virtual void | subdomainSetup () |
| virtual void | customSetup (const ExecFlagType &) |
| const ExecFlagEnum & | getExecuteOnEnum () const |
| PerfGraph & | perfGraph () |
| T & | getSampler (const std::string &name) |
| Sampler & | getSampler (const std::string &name) |
| T & | getSamplerByName (const SamplerName &name) |
| Sampler & | getSamplerByName (const SamplerName &name) |
| const VectorPostprocessorValue & | getVectorPostprocessorValue (const std::string ¶m_name, const std::string &vector_name) const |
| const VectorPostprocessorValue & | getVectorPostprocessorValue (const std::string ¶m_name, const std::string &vector_name, bool needs_broadcast) const |
| const VectorPostprocessorValue & | getVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name) const |
| const VectorPostprocessorValue & | getVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name, bool needs_broadcast) const |
| const VectorPostprocessorValue & | getVectorPostprocessorValueOld (const std::string ¶m_name, const std::string &vector_name) const |
| const VectorPostprocessorValue & | getVectorPostprocessorValueOld (const std::string ¶m_name, const std::string &vector_name, bool needs_broadcast) const |
| const VectorPostprocessorValue & | getVectorPostprocessorValueOldByName (const VectorPostprocessorName &name, const std::string &vector_name) const |
| const VectorPostprocessorValue & | getVectorPostprocessorValueOldByName (const VectorPostprocessorName &name, const std::string &vector_name, bool needs_broadcast) const |
| const ScatterVectorPostprocessorValue & | getScatterVectorPostprocessorValue (const std::string ¶m_name, const std::string &vector_name) const |
| const ScatterVectorPostprocessorValue & | getScatterVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name) const |
| const ScatterVectorPostprocessorValue & | getScatterVectorPostprocessorValueOld (const std::string ¶m_name, const std::string &vector_name) const |
| const ScatterVectorPostprocessorValue & | getScatterVectorPostprocessorValueOldByName (const VectorPostprocessorName &name, const std::string &vector_name) const |
| bool | hasVectorPostprocessor (const std::string ¶m_name, const std::string &vector_name) const |
| bool | hasVectorPostprocessor (const std::string ¶m_name) const |
| bool | hasVectorPostprocessorByName (const VectorPostprocessorName &name, const std::string &vector_name) const |
| bool | hasVectorPostprocessorByName (const VectorPostprocessorName &name) const |
| const VectorPostprocessorName & | getVectorPostprocessorName (const std::string ¶m_name) const |
| DenseMatrix< Real > | getGlobalSamples () |
| DenseMatrix< Real > | getGlobalSamples () |
| DenseMatrix< Real > | getLocalSamples () |
| DenseMatrix< Real > | getLocalSamples () |
| dof_id_type | getLocalRowBegin () const |
| dof_id_type | getLocalRowBegin () const |
| dof_id_type | getLocalRowEnd () const |
| dof_id_type | getLocalRowEnd () const |
| const Distribution & | getDistribution (const std::string &name) const |
| const T & | getDistribution (const std::string &name) const |
| const Distribution & | getDistribution (const std::string &name) const |
| const T & | getDistribution (const std::string &name) const |
| const Distribution & | getDistributionByName (const DistributionName &name) const |
| const T & | getDistributionByName (const std::string &name) const |
| const Distribution & | getDistributionByName (const DistributionName &name) const |
| const T & | getDistributionByName (const std::string &name) const |
| bool | isVectorPostprocessorDistributed (const std::string ¶m_name) const |
| bool | isVectorPostprocessorDistributed (const std::string ¶m_name) const |
| bool | isVectorPostprocessorDistributedByName (const VectorPostprocessorName &name) const |
| bool | isVectorPostprocessorDistributedByName (const VectorPostprocessorName &name) const |
| const Parallel::Communicator & | comm () const |
| processor_id_type | n_processors () const |
| processor_id_type | processor_id () const |
| bool | isImplicit () |
| Moose::StateArg | determineState () const |
Static Public Member Functions | |
| static InputParameters | validParams () |
| static void | callMooseError (MooseApp *const app, const InputParameters ¶ms, std::string msg, const bool with_prefix, const hit::Node *node) |
Public Attributes | |
| usingCombinedWarningSolutionWarnings | |
| const ConsoleStream | _console |
Static Public Attributes | |
| static const std::string | type_param |
| static const std::string | name_param |
| static const std::string | unique_name_param |
| static const std::string | app_param |
| static const std::string | moose_base_param |
| static const std::string | kokkos_object_param |
Protected Types | |
| enum | CommMethod |
Protected Member Functions | |
| virtual Real | computeSample (dof_id_type row_index, dof_id_type col_index) override |
| Return the sample for the given row (the sample index) and column (the parameter index) More... | |
| void | setNumberOfRandomSeeds (std::size_t number) |
| Real | getRand (unsigned int index=0) |
| uint32_t | getRandl (unsigned int index, uint32_t lower, uint32_t upper) |
| virtual LocalRankConfig | constructRankConfig (bool batch_mode) const |
| void | flagInvalidSolutionInternal (const InvalidSolutionID invalid_solution_id) const |
| InvalidSolutionID | registerInvalidSolutionInternal (const std::string &message, const bool warning) const |
| PerfID | registerTimedSection (const std::string §ion_name, const unsigned int level) const |
| PerfID | registerTimedSection (const std::string §ion_name, const unsigned int level, const std::string &live_message, const bool print_dots=true) const |
| std::string | timedSectionName (const std::string §ion_name) const |
| virtual void | addVectorPostprocessorDependencyHelper (const VectorPostprocessorName &) const |
| const ReporterContextBase & | getReporterContextBaseByName (const ReporterName &reporter_name) const |
| const ReporterName & | getReporterName (const std::string ¶m_name) const |
| virtual void | addReporterDependencyHelper (const ReporterName &) |
| void | setNumberOfRows (dof_id_type n_rows) |
| void | setNumberOfRows (dof_id_type n_rows) |
| void | setNumberOfCols (dof_id_type n_cols) |
| void | setNumberOfCols (dof_id_type n_cols) |
| virtual void | sampleSetUp (const SampleMode) |
| virtual void | sampleSetUp (const SampleMode) |
| virtual void | sampleTearDown (const SampleMode) |
| virtual void | sampleTearDown (const SampleMode) |
| virtual void | computeSampleMatrix (DenseMatrix< Real > &matrix) |
| virtual void | computeSampleMatrix (DenseMatrix< Real > &matrix) |
| virtual void | computeLocalSampleMatrix (DenseMatrix< Real > &matrix) |
| virtual void | computeLocalSampleMatrix (DenseMatrix< Real > &matrix) |
| virtual void | computeSampleRow (dof_id_type i, std::vector< Real > &data) |
| virtual void | computeSampleRow (dof_id_type i, std::vector< Real > &data) |
| virtual void | advanceGenerators (const dof_id_type count) |
| virtual void | advanceGenerators (const dof_id_type count) |
| virtual void | advanceGenerator (const unsigned int seed_index, const dof_id_type count) |
| virtual void | advanceGenerator (const unsigned int seed_index, const dof_id_type count) |
| void | setAutoAdvanceGenerators (const bool state) |
| void | setAutoAdvanceGenerators (const bool state) |
| void | shuffle (std::vector< T > &data, const std::size_t seed_index=0, const CommMethod method=CommMethod::LOCAL) |
| void | shuffle (std::vector< T > &data, const std::size_t seed_index=0, const CommMethod method=CommMethod::LOCAL) |
| virtual void | executeSetUp () |
| virtual void | executeSetUp () |
| virtual void | executeTearDown () |
| virtual void | executeTearDown () |
| void | saveGeneratorState () |
| void | saveGeneratorState () |
| void | restoreGeneratorState () |
| void | restoreGeneratorState () |
| const T & | getReporterValue (const std::string ¶m_name, const std::size_t time_index=0) |
| const T & | getReporterValue (const std::string ¶m_name, ReporterMode mode, const std::size_t time_index=0) |
| const T & | getReporterValue (const std::string ¶m_name, const std::size_t time_index=0) |
| const T & | getReporterValue (const std::string ¶m_name, ReporterMode mode, const std::size_t time_index=0) |
| const T & | getReporterValueByName (const ReporterName &reporter_name, const std::size_t time_index=0) |
| const T & | getReporterValueByName (const ReporterName &reporter_name, ReporterMode mode, const std::size_t time_index=0) |
| const T & | getReporterValueByName (const ReporterName &reporter_name, const std::size_t time_index=0) |
| const T & | getReporterValueByName (const ReporterName &reporter_name, ReporterMode mode, const std::size_t time_index=0) |
| bool | hasReporterValue (const std::string ¶m_name) const |
| bool | hasReporterValue (const std::string ¶m_name) const |
| bool | hasReporterValue (const std::string ¶m_name) const |
| bool | hasReporterValue (const std::string ¶m_name) const |
| bool | hasReporterValueByName (const ReporterName &reporter_name) const |
| bool | hasReporterValueByName (const ReporterName &reporter_name) const |
| bool | hasReporterValueByName (const ReporterName &reporter_name) const |
| bool | hasReporterValueByName (const ReporterName &reporter_name) const |
Protected Attributes | |
| std::vector< const Distribution * > | _distributions |
| Storage for distribution objects to be utilized. More... | |
| const std::vector< Real > & | _proposal_std |
| The proposal distribution standard deviations. More... | |
| const std::vector< Real > & | _initial_values |
| Initial values values vector to start the importance sampler. More... | |
| const Real & | _output_limit |
| The output limit, exceedance of which indicates failure. More... | |
| const int & | _num_samples_train |
| Number of samples to train the importance sampler. More... | |
| const int & | _num_importance_sampling_steps |
| Number of importance sampling steps (after the importance distribution has been trained) More... | |
| const Real & | _std_factor |
| Factor to be multiplied to the standard deviation of the proposal distribution. More... | |
| const bool & | _use_absolute_value |
| Absolute value of the model result. Use this when failure is defined as a non-exceedance rather than an exceedance. More... | |
| const unsigned int & | _num_random_seeds |
| Initialize a certain number of random seeds. Change from the default only if you have to. More... | |
| bool | _is_sampling_completed |
| True if the sampling is completed. More... | |
| NONE | |
| LOCAL | |
| SEMI_LOCAL | |
| const dof_id_type | _min_procs_per_row |
| const dof_id_type | _max_procs_per_row |
| libMesh::Parallel::Communicator | _local_comm |
| const bool & | _enabled |
| MooseApp & | _app |
| Factory & | _factory |
| ActionFactory & | _action_factory |
| const std::string & | _type |
| const std::string & | _name |
| const InputParameters & | _pars |
| const ExecFlagEnum & | _execute_enum |
| const ExecFlagType & | _current_execute_flag |
| MooseApp & | _pg_moose_app |
| const std::string | _prefix |
| const Parallel::Communicator & | _communicator |
| const InputParameters & | _ti_params |
| FEProblemBase & | _ti_feproblem |
| bool | _is_implicit |
| Real & | _t |
| const Real & | _t_old |
| int & | _t_step |
| Real & | _dt |
| Real & | _dt_old |
| bool | _is_transient |
Private Attributes | |
| const std::vector< std::vector< Real > > & | _inputs |
| Storage for the inputs vector obtained from the reporter. More... | |
| int | _check_step |
| Ensure that the MCMC algorithm proceeds in a sequential fashion. More... | |
| std::vector< Real > | _prev_value |
| For proposing the next sample in the MCMC algorithm. More... | |
| std::vector< Real > | _mean_sto |
| Storage for means of input values for proposing the next sample. More... | |
| std::vector< Real > | _std_sto |
| Storage for standard deviations of input values for proposing the next sample. More... | |
| std::vector< std::vector< Real > > | _inputs_sto |
| Storage for previously accepted samples by the decision reporter system. More... | |
| int | _retraining_steps |
| Number of retraining performed. More... | |
| const std::vector< bool > *const | _gp_flag |
| Indicate whether GP prediction is good or bad to influence next proposed sample. More... | |
A class used to perform Adaptive Importance Sampling using a Markov Chain Monte Carlo algorithm.
Definition at line 18 of file AdaptiveImportanceSampler.h.
| AdaptiveImportanceSampler::AdaptiveImportanceSampler | ( | const InputParameters & | parameters | ) |
Definition at line 53 of file AdaptiveImportanceSampler.C.
|
overrideprotectedvirtual |
Return the sample for the given row (the sample index) and column (the parameter index)
Implements Sampler.
Definition at line 111 of file AdaptiveImportanceSampler.C.
|
inline |
Definition at line 44 of file AdaptiveImportanceSampler.h.
Referenced by AdaptiveImportanceStats::AdaptiveImportanceStats().
|
inline |
Definition at line 38 of file AdaptiveImportanceSampler.h.
Referenced by AdaptiveImportanceStats::execute().
|
inline |
Definition at line 41 of file AdaptiveImportanceSampler.h.
Referenced by AdaptiveImportanceStats::execute().
|
inline |
Definition at line 26 of file AdaptiveImportanceSampler.h.
Referenced by AdaptiveMonteCarloDecision::AdaptiveMonteCarloDecision(), and AdaptiveMonteCarloDecision::reinitChain().
|
inline |
Definition at line 29 of file AdaptiveImportanceSampler.h.
Referenced by AdaptiveImportanceStats::execute(), and AdaptiveMonteCarloDecision::execute().
|
inline |
Definition at line 35 of file AdaptiveImportanceSampler.h.
Referenced by AdaptiveMonteCarloDecision::AdaptiveMonteCarloDecision(), and AdaptiveImportanceStats::execute().
|
inline |
Definition at line 47 of file AdaptiveImportanceSampler.h.
Referenced by AdaptiveImportanceStats::AdaptiveImportanceStats().
|
inline |
Definition at line 32 of file AdaptiveImportanceSampler.h.
Referenced by AdaptiveImportanceStats::execute(), and AdaptiveMonteCarloDecision::execute().
|
inlineoverridevirtual |
Returns true if the adaptive sampling is completed.
Reimplemented from Sampler.
Definition at line 52 of file AdaptiveImportanceSampler.h.
|
static |
Definition at line 19 of file AdaptiveImportanceSampler.C.
Referenced by AISActiveLearning::validParams().
|
private |
Ensure that the MCMC algorithm proceeds in a sequential fashion.
Definition at line 93 of file AdaptiveImportanceSampler.h.
Referenced by AdaptiveImportanceSampler(), and computeSample().
|
protected |
Storage for distribution objects to be utilized.
Definition at line 59 of file AdaptiveImportanceSampler.h.
Referenced by AdaptiveImportanceSampler(), computeSample(), and getDistributionNames().
|
private |
Indicate whether GP prediction is good or bad to influence next proposed sample.
Definition at line 111 of file AdaptiveImportanceSampler.h.
Referenced by computeSample().
|
protected |
Initial values values vector to start the importance sampler.
Definition at line 65 of file AdaptiveImportanceSampler.h.
Referenced by AdaptiveImportanceSampler(), and getInitialValues().
|
private |
Storage for the inputs vector obtained from the reporter.
Definition at line 90 of file AdaptiveImportanceSampler.h.
Referenced by computeSample().
|
private |
Storage for previously accepted samples by the decision reporter system.
Definition at line 105 of file AdaptiveImportanceSampler.h.
Referenced by AdaptiveImportanceSampler(), and computeSample().
|
protected |
True if the sampling is completed.
Definition at line 86 of file AdaptiveImportanceSampler.h.
Referenced by computeSample(), and isAdaptiveSamplingCompleted().
|
private |
Storage for means of input values for proposing the next sample.
Definition at line 99 of file AdaptiveImportanceSampler.h.
Referenced by AdaptiveImportanceSampler(), computeSample(), and getImportanceVectorMean().
|
protected |
Number of importance sampling steps (after the importance distribution has been trained)
Definition at line 74 of file AdaptiveImportanceSampler.h.
Referenced by computeSample().
|
protected |
Initialize a certain number of random seeds. Change from the default only if you have to.
Definition at line 83 of file AdaptiveImportanceSampler.h.
Referenced by AdaptiveImportanceSampler().
|
protected |
Number of samples to train the importance sampler.
Definition at line 71 of file AdaptiveImportanceSampler.h.
Referenced by computeSample(), and getNumSamplesTrain().
|
protected |
The output limit, exceedance of which indicates failure.
Definition at line 68 of file AdaptiveImportanceSampler.h.
Referenced by getOutputLimit().
|
private |
For proposing the next sample in the MCMC algorithm.
Definition at line 96 of file AdaptiveImportanceSampler.h.
Referenced by AdaptiveImportanceSampler(), and computeSample().
|
protected |
The proposal distribution standard deviations.
Definition at line 62 of file AdaptiveImportanceSampler.h.
Referenced by computeSample().
|
private |
Number of retraining performed.
Definition at line 108 of file AdaptiveImportanceSampler.h.
Referenced by computeSample().
|
protected |
Factor to be multiplied to the standard deviation of the proposal distribution.
Definition at line 77 of file AdaptiveImportanceSampler.h.
Referenced by computeSample(), and getStdFactor().
|
private |
Storage for standard deviations of input values for proposing the next sample.
Definition at line 102 of file AdaptiveImportanceSampler.h.
Referenced by AdaptiveImportanceSampler(), computeSample(), and getImportanceVectorStd().
|
protected |
Absolute value of the model result. Use this when failure is defined as a non-exceedance rather than an exceedance.
Definition at line 80 of file AdaptiveImportanceSampler.h.
Referenced by getUseAbsoluteValue().
1.8.14