File AdaptiveImportanceSampler.h

namespace lsst

Class for a simple mapping implementing a generic AstrometryTransform.

Remove all non-astronomical counts from the Chunk Exposure’s pixels.

Forward declarations for lsst::utils::Cache

For details on the Cache class, see the Cache.h file.

It uses a template rather than a pointer so that the derived classes can use the specifics of the transform. The class simplePolyMapping overloads a few routines.

A base class for image defects

Numeric constants used by the Integrate.h integrator routines.

Compute Image Statistics

Note

Gauss-Kronrod-Patterson quadrature coefficients for use in quadpack routine qng. These coefficients were calculated with 101 decimal digit arithmetic by L. W. Fullerton, Bell Labs, Nov 1981.

Note

The Statistics class itself can only handle lsst::afw::image::MaskedImage() types. The philosophy has been to handle other types by making them look like lsst::afw::image::MaskedImage() and reusing that code. Users should have no need to instantiate a Statistics object directly, but should use the overloaded makeStatistics() factory functions.

namespace meas
namespace modelfit
class AdaptiveImportanceSampler : public lsst::meas::modelfit::Sampler
#include <AdaptiveImportanceSampler.h>

Sampler class that performs Monte Carlo sampling, while iteratively updating the analytic distribution from which points are drawn.

Between the iterations defined in the control object, the prior is applied to the samples, and the mixture distribution is updated using expectation-maximization to match the samples.

Public Functions

lsst::meas::modelfit::AdaptiveImportanceSampler::AdaptiveImportanceSampler(afw::table::Schema & sampleSchema, PTR( afw::math::Random ) rng, std::map< int, ImportanceSamplerControl > const & ctrls, bool doSaveIterations = false)

Construct a new sampler.

Parameters
  • [inout] sampleSchema: Schema for the catalog of samples filled by the Sampler; will be modified to include sampler-specific fields.

  • [in] rng: Random number generator to use to generate samples.

  • [in] ctrls: Vector of control objects that define the iterations.

  • [in] doSaveIterations: Whether to save intermediate SampleSets and associated proposal distributions.

void lsst::meas::modelfit::AdaptiveImportanceSampler::run(SamplingObjective const & objective, PTR( Mixture ) proposal, afw::table::BaseCatalog & samples) const
double computeNormalizedPerplexity(afw::table::BaseCatalog const &samples) const
double computeEffectiveSampleSizeFraction(afw::table::BaseCatalog const &samples) const

Private Functions

PTR(afw::math::Random)

Private Members

bool _doSaveIterations
std::map<int, ImportanceSamplerControl> _ctrls
afw::table::Key<Scalar> _weightKey
afw::table::Key<Scalar> _objectiveKey
afw::table::Key<Scalar> _proposalKey
afw::table::Key<afw::table::Array<Scalar>> _parametersKey
afw::table::Key<int> _iterCtrlKey
afw::table::Key<int> _iterRepeatKey
class ImportanceSamplerControl
#include <AdaptiveImportanceSampler.h>

Control object for one iteration of adaptive importance sampling.

See

AdaptiveImportanceSampler, AdaptiveImportanceSamplerTask

Public Functions

lsst::meas::modelfit::ImportanceSamplerControl::LSST_CONTROL_FIELD(nSamples, int, "Number of Monte Carlo samples to draw")
lsst::meas::modelfit::ImportanceSamplerControl::LSST_CONTROL_FIELD(nUpdateSteps, int, "Number of Expectation-Maximization update iterations")
lsst::meas::modelfit::ImportanceSamplerControl::LSST_CONTROL_FIELD(tau1, double, "Damping parameter for E-M update (see Mixture::updateEM )")
lsst::meas::modelfit::ImportanceSamplerControl::LSST_CONTROL_FIELD(tau2, double, "Damping parameter for E-M update (see Mixture::updateEM )")
lsst::meas::modelfit::ImportanceSamplerControl::LSST_CONTROL_FIELD(targetPerplexity, double, "Minimum value for normalized perplexity after this iteration; if the actual value is less " "than this, this iteration will be repeated up to maxRepeat times until the target is met. " "In addition, if any previous iteration meets this target, this iteration will be skipped.")
lsst::meas::modelfit::ImportanceSamplerControl::LSST_CONTROL_FIELD(maxRepeat, int, "Maximum number of times this iteration will be repeated to meet the perplexityTarget")
ImportanceSamplerControl()