24 #ifndef LSST_MEAS_MODELFIT_AdaptiveImportanceSampler_h_INCLUDED
25 #define LSST_MEAS_MODELFIT_AdaptiveImportanceSampler_h_INCLUDED
29 #include "lsst/pex/config.h"
30 #include "lsst/afw/table/Schema.h"
34 namespace lsst {
namespace meas {
namespace modelfit {
43 LSST_CONTROL_FIELD(
nSamples,
int,
"Number of Monte Carlo samples to draw");
44 LSST_CONTROL_FIELD(
nUpdateSteps,
int,
"Number of Expectation-Maximization update iterations");
45 LSST_CONTROL_FIELD(
tau1,
double,
"Damping parameter for E-M update (see Mixture::updateEM)");
46 LSST_CONTROL_FIELD(
tau2,
double,
"Damping parameter for E-M update (see Mixture::updateEM)");
49 "Minimum value for normalized perplexity after this iteration; if the actual value is less "
50 "than this, this iteration will be repeated up to maxRepeat times until the target is met. "
51 "In addition, if any previous iteration meets this target, this iteration will be skipped."
55 "Maximum number of times this iteration will be repeated to meet the perplexityTarget"
84 afw::table::Schema & sampleSchema,
85 PTR(afw::math::Random) rng,
86 std::map<int,ImportanceSamplerControl>
const & ctrls,
87 bool doSaveIterations=
false
93 afw::table::BaseCatalog & samples
101 bool _doSaveIterations;
102 PTR(afw::math::Random) _rng;
103 std::map<int,ImportanceSamplerControl> _ctrls;
104 afw::table::Key<Scalar> _weightKey;
105 afw::table::Key<Scalar> _objectiveKey;
106 afw::table::Key<Scalar> _proposalKey;
107 afw::table::Key< afw::table::Array<Scalar> > _parametersKey;
108 afw::table::Key<int> _iterCtrlKey;
109 afw::table::Key<int> _iterRepeatKey;
114 #endif // !LSST_MEAS_MODELFIT_AdaptiveImportanceSampler_h_INCLUDED
void run(SamplingObjective const &objective, boost::shared_ptr< Mixture > proposal, afw::table::BaseCatalog &samples) const override
double tau2
"Damping parameter for E-M update (see Mixture::updateEM)" ;
double tau1
"Damping parameter for E-M update (see Mixture::updateEM)" ;
double computeNormalizedPerplexity(afw::table::BaseCatalog const &samples) const
Sampler class that performs Monte Carlo sampling, while iteratively updating the analytic distributio...
Control object for one iteration of adaptive importance sampling.
int maxRepeat
"Maximum number of times this iteration will be repeated to meet the perplexityTarget" ; ...
int nUpdateSteps
"Number of Expectation-Maximization update iterations" ;
double computeEffectiveSampleSizeFraction(afw::table::BaseCatalog const &samples) const
ImportanceSamplerControl()
AdaptiveImportanceSampler(afw::table::Schema &sampleSchema, boost::shared_ptr< afw::math::Random > rng, std::map< int, ImportanceSamplerControl > const &ctrls, bool doSaveIterations=false)
Construct a new sampler.
double targetPerplexity
"Minimum value for normalized perplexity after this iteration; if the actual value is less " "than th...
int nSamples
"Number of Monte Carlo samples to draw" ;