#include <SmolyakEstimator.h>
Definition at line 16 of file SmolyakEstimator.h.
Classes | |
struct | SmolyTerm |
Public Member Functions | |
SmolyakEstimator (std::shared_ptr< muq::Modeling::ModPiece > const &modelIn) | |
virtual | ~SmolyakEstimator ()=default |
virtual EstimateType | Compute (std::shared_ptr< muq::Utilities::MultiIndexSet > const &fixedSet, boost::property_tree::ptree options=boost::property_tree::ptree()) |
virtual EstimateType | Adapt (boost::property_tree::ptree options) |
virtual double | Error () const |
virtual unsigned int | NumEvals () const |
virtual std::vector< double > | ErrorHistory () const |
virtual std::vector< int > | EvalHistory () const |
virtual std::vector< double > | TimeHistory () const |
virtual std::vector< std::vector< Eigen::VectorXd > > | PointHistory () const |
virtual std::vector< std::vector< std::shared_ptr< muq::Utilities::MultiIndex > > > | TermHistory () const |
SmolyakEstimator::SmolyakEstimator | ( | std::shared_ptr< muq::Modeling::ModPiece > const & | modelIn | ) |
Definition at line 13 of file SmolyakEstimator.cpp.
|
virtualdefault |
|
virtual |
To be called after Compute, this will continue to refine the estimate until the stopping criteria in options is met.
Definition at line 73 of file SmolyakEstimator.cpp.
|
protectedpure virtual |
Implemented in muq::Approximation::AdaptiveSmolyakPCE, and muq::Approximation::AdaptiveSmolyakQuadrature.
|
protectedvirtual |
Definition at line 163 of file SmolyakEstimator.cpp.
|
protectedvirtual |
|
protected |
Definition at line 389 of file SmolyakEstimator.cpp.
|
inlineprotected |
Definition at line 144 of file SmolyakEstimator.h.
References muq::Modeling::DynamicKDTreeAdaptor< Distance, IndexType >::m_data, and muq::Approximation::SmolyakEstimator< EstimateType >::pointCache.
|
virtual |
This is the main function to constructing static or adaptive Smolyak estimates.
Definition at line 324 of file SmolyakEstimator.cpp.
|
protectedpure virtual |
Implemented in muq::Approximation::AdaptiveSmolyakPCE, and muq::Approximation::AdaptiveSmolyakQuadrature.
|
protectedpure virtual |
This function works in tandem with the OneTermPoints function. After the model has been evaluated at the points returned by OneTermPoints, this function will compute an estimate with the new model evaluations. In the quadrature setting, the estimate will be computed with a weighted sum of the model evaluations stored in the modEvals vector.
Implemented in muq::Approximation::AdaptiveSmolyakQuadrature, and muq::Approximation::AdaptiveSmolyakPCE.
|
protectedvirtual |
Definition at line 50 of file SmolyakEstimator.cpp.
|
protectedvirtual |
Should compute sum(smolyVals[i] * smolyWeights[i]) and return the result
Definition at line 24 of file SmolyakEstimator.cpp.
|
inlinevirtual |
Returns the current estimate of the global error in the Smolyak approximation.
Definition at line 38 of file SmolyakEstimator.h.
References muq::Approximation::SmolyakEstimator< EstimateType >::globalError.
|
inlinevirtual |
Returns the history of the global error for each adaptation iteration.
Definition at line 44 of file SmolyakEstimator.h.
References muq::Approximation::SmolyakEstimator< EstimateType >::errorHistory.
|
inlinevirtual |
Returns the cumulative number of evaluations after each adaptation iteration. Note that when Compute() is called, the number of evaluations is reset but the evaluation cache is not. If Compute() is called more than once, this may lead to counterintuitive evaluation histories because the points that were evaluated in the first call to Compute() will not be added to the history.
Definition at line 52 of file SmolyakEstimator.h.
References muq::Approximation::SmolyakEstimator< EstimateType >::evalHistory.
|
protectedvirtual |
Evaluates the model at specified points in the cache and saves the results to the evalCache vector.
[in] | ptsToEval | A set of indices into the cache with points that need evaluation. |
Definition at line 299 of file SmolyakEstimator.cpp.
|
inlineprotected |
Definition at line 142 of file SmolyakEstimator.h.
References muq::Modeling::DynamicKDTreeAdaptor< Distance, IndexType >::m_data, and muq::Approximation::SmolyakEstimator< EstimateType >::pointCache.
|
protected |
|
inlinevirtual |
Returns the number of model evaluations this factory has performed.
Definition at line 41 of file SmolyakEstimator.h.
References muq::Approximation::SmolyakEstimator< EstimateType >::numEvals.
|
protectedpure virtual |
Computes the locations where the model will need to be evaluated in order to construct a single tensor-product estimate. For example, in the Smolyak quadrature setting, this function will return the quadrature points coming from the tensor product quadrature rule defined by the multiindex.
This function works in tandem with the ComputeOneTerm function, which takes model evaluations and actually returns the tensor product estimate. These two functions are split to allow the SmolyakEstimator to handle any job scheduling or caching that may be needed for parallel model evaluations.
Implemented in muq::Approximation::AdaptiveSmolyakQuadrature, and muq::Approximation::AdaptiveSmolyakPCE.
|
virtual |
Return the points that were evaluated during each adaptation step.
Definition at line 173 of file SmolyakEstimator.cpp.
|
protectedvirtual |
Refine the approximation by adding to the computed terms. Returns true if any new terms were added.
Definition at line 111 of file SmolyakEstimator.cpp.
|
protectedvirtual |
Definition at line 358 of file SmolyakEstimator.cpp.
|
inlinevirtual |
Returns the terms used in the estimate as the a function of adaptation iterations.
Definition at line 61 of file SmolyakEstimator.h.
References muq::Approximation::SmolyakEstimator< EstimateType >::termHistory.
|
inlinevirtual |
Returns the cumulative runtime (in seconds) for each adaptation iteration.
Definition at line 55 of file SmolyakEstimator.h.
References muq::Approximation::SmolyakEstimator< EstimateType >::timeHistory.
|
protectedvirtual |
Updates the local error indicators for terms on the leading edge.
Definition at line 308 of file SmolyakEstimator.cpp.
|
protected |
Definition at line 146 of file SmolyakEstimator.h.
|
protected |
Holds the history of the error. Each component corresponds to an iteration.
Definition at line 123 of file SmolyakEstimator.h.
Referenced by muq::Approximation::SmolyakEstimator< EstimateType >::ErrorHistory().
|
protected |
Tolerance on the global error indicator to continue adapting.
Definition at line 152 of file SmolyakEstimator.h.
|
protected |
Definition at line 139 of file SmolyakEstimator.h.
|
protected |
Holds the history of how many model evaluations have occured. Each component corresponds to an adaptation iteration.
Definition at line 126 of file SmolyakEstimator.h.
Referenced by muq::Approximation::SmolyakEstimator< EstimateType >::EvalHistory().
|
protected |
Definition at line 195 of file SmolyakEstimator.h.
Referenced by muq::Approximation::SmolyakEstimator< EstimateType >::Error().
|
protected |
Tolerance on the maximum number of evaluations.
Definition at line 155 of file SmolyakEstimator.h.
|
protected |
The model used to construct the approximations.
Definition at line 117 of file SmolyakEstimator.h.
|
protected |
The number of model evaluations that have been performed.
Definition at line 158 of file SmolyakEstimator.h.
Referenced by muq::Approximation::SmolyakEstimator< EstimateType >::NumEvals().
|
protected |
Definition at line 197 of file SmolyakEstimator.h.
|
protected |
A cache of model evaluations.
Definition at line 138 of file SmolyakEstimator.h.
Referenced by muq::Approximation::SmolyakEstimator< EstimateType >::CacheSize(), and muq::Approximation::SmolyakEstimator< EstimateType >::GetFromCache().
|
protected |
Indices in the cache for the points that were evaluated during each adaptation iteration.
Definition at line 132 of file SmolyakEstimator.h.
|
protected |
The terms that are added during each refinement.
Definition at line 135 of file SmolyakEstimator.h.
Referenced by muq::Approximation::SmolyakEstimator< EstimateType >::TermHistory().
|
protected |
Multiindices defining each tensor product term in the Smolyak approximation.
Definition at line 120 of file SmolyakEstimator.h.
|
protected |
Definition at line 193 of file SmolyakEstimator.h.
|
protected |
Holds the history of how. Each component corresponds to an adaptation iteration.
Definition at line 129 of file SmolyakEstimator.h.
Referenced by muq::Approximation::SmolyakEstimator< EstimateType >::TimeHistory().
|
protected |
Tolerance on the time (in seconds) allowed to continue adapting.
Definition at line 149 of file SmolyakEstimator.h.