MultipleImportanceSampler Class Reference
"Optimally" combines samples taken from multiple sampling distributions with respect to a function, 'f', whose value we are trying to integate over a given domain,'D'. D is assumed to be the union of the domains of the individual underlying distributions. More...
#include <MultipleImportanceSampler.h>

Public Member Functions | |
Constructors | |
| |
| MultipleImportanceSampler (const SamplerList &samplers, unsigned ni=1) | |
| MultipleImportanceSampler (const SamplerList &samplers, const IntList &ni) | |
| virtual | ~MultipleImportanceSampler () |
Initialization | |
| virtual void | init () |
| Initializes the weight computation function based on this class' PropertyMap. | |
Main usage interface | |
| virtual void | sample (WeightedEventList &results) |
Generates ni samples from each sampler pi in { p1,p1,...,pn }, along with sample weights, and stores the N weighted events in the out parameter results. | |
Protected Types | |
| typedef void(MultipleImportanceSampler::* | ComputeWeightFunc )(WeightedEvent &event, unsigned i) |
Protected Member Functions | |
| virtual void | _computeWeightBalance (WeightedEvent &event, unsigned i) |
| virtual void | _computeWeightCutoff (WeightedEvent &event, unsigned i) |
| virtual void | _computeWeightPower (WeightedEvent &event, unsigned i) |
| virtual void | _computeWeightMaximum (WeightedEvent &event, unsigned i) |
Protected Attributes | |
| SamplerList | m_samplers |
| list of distributions from which to draw samples from | |
| unsigned | m_N |
| number of sampling distributions in m_samplers | |
| unsigned | m_n |
| total number of samples | |
| IntList | m_ni |
| sampler-by-sampler breakdown of number of samples | |
| ComputeWeightFunc | m_computeWeightFunc |
| weight computation for individual samples (see init()) | |
| union { | |
| real_t m_beta | |
| input to power heuristic | |
| real_t m_alpha | |
| input to alpha heuristic | |
| }; | |
Detailed Description
"Optimally" combines samples taken from multiple sampling distributions with respect to a function, 'f', whose value we are trying to integate over a given domain,'D'. D is assumed to be the union of the domains of the individual underlying distributions.
- Date:
- Fall 2008
Multiple importance sampling generalizes this one step further. Say we have n different sampling distributions p1,p2,...,pn, and our function f, may be separated or factored into several functions, f1,f2,...fm. By designing different sampling distributions to focus on one or more of the simpler functions, fi, we can combine samples from the different sampling distributions, each of which may be better at estimating some important component (subfunction) of f, we can gain a much better final sampling distribution, p, which captures all of the relevant aspects of f in an intuitive, modularized manner (where each pi can be tuned towards capturing a different fi). How to go about combining samples from n distributions, all or some of which may be good or bad estimators of f, is a very difficult problem in this generic of a setting. Veach and Guibas (1995) showed several provably good ways of optimally combining sampling techniques for Monte Carlo integration. This class implements their multiple importance sampling model, including several heuristics they gave which attempt to combine samples in slightly different ways that may work better in one situation versus another. These include the balance, cutoff, power, and maximum heuristics.
- Note:
- for more information and theoretical details, see Veach and Guibas. Optimally Combining Sampling Techniques for Monte Carlo Rendering. In Proceedings of the 22nd Annual Conference on Computer Graphics and interactive Techniques S.G. Mair and R. Cook, Eds. SIGGRAPH '95. ACM, New York, NY, 419-428.
Definition at line 85 of file MultipleImportanceSampler.h.
Member Typedef Documentation
typedef void(MultipleImportanceSampler::* MultipleImportanceSampler::ComputeWeightFunc)(WeightedEvent &event, unsigned i) [protected] |
Constructor & Destructor Documentation
| MultipleImportanceSampler::MultipleImportanceSampler | ( | const SamplerList & | samplers, | |
| unsigned | ni = 1 | |||
| ) | [inline] |
- Parameters:
-
ni is the constant number of samples to take per sampler
Definition at line 95 of file MultipleImportanceSampler.h.
| MultipleImportanceSampler::MultipleImportanceSampler | ( | const SamplerList & | samplers, | |
| const IntList & | ni | |||
| ) | [inline] |
- Parameters:
-
ni holds the variable number of samples to take per sampler
Definition at line 104 of file MultipleImportanceSampler.h.
| virtual MultipleImportanceSampler::~MultipleImportanceSampler | ( | ) | [inline, virtual] |
Definition at line 116 of file MultipleImportanceSampler.h.
Member Function Documentation
| void MultipleImportanceSampler::init | ( | ) | [virtual] |
Initializes the weight computation function based on this class' PropertyMap.
- Note:
- defaults to balance heuristic
Definition at line 76 of file MultipleImportanceSampler.cpp.
| void MultipleImportanceSampler::sample | ( | WeightedEventList & | results | ) | [virtual] |
Generates ni samples from each sampler pi in { p1,p1,...,pn }, along with sample weights, and stores the N weighted events in the out parameter results.
- Note:
- 'results' is first cleared before adding any samples
Definition at line 96 of file MultipleImportanceSampler.cpp.
| void MultipleImportanceSampler::_computeWeightBalance | ( | WeightedEvent & | event, | |
| unsigned | i | |||
| ) | [protected, virtual] |
Definition at line 111 of file MultipleImportanceSampler.cpp.
| void MultipleImportanceSampler::_computeWeightCutoff | ( | WeightedEvent & | event, | |
| unsigned | i | |||
| ) | [protected, virtual] |
Definition at line 131 of file MultipleImportanceSampler.cpp.
| void MultipleImportanceSampler::_computeWeightPower | ( | WeightedEvent & | event, | |
| unsigned | i | |||
| ) | [protected, virtual] |
Definition at line 158 of file MultipleImportanceSampler.cpp.
| void MultipleImportanceSampler::_computeWeightMaximum | ( | WeightedEvent & | event, | |
| unsigned | i | |||
| ) | [protected, virtual] |
Definition at line 174 of file MultipleImportanceSampler.cpp.
Member Data Documentation
SamplerList MultipleImportanceSampler::m_samplers [protected] |
list of distributions from which to draw samples from
Definition at line 163 of file MultipleImportanceSampler.h.
unsigned MultipleImportanceSampler::m_N [protected] |
number of sampling distributions in m_samplers
Definition at line 166 of file MultipleImportanceSampler.h.
unsigned MultipleImportanceSampler::m_n [protected] |
IntList MultipleImportanceSampler::m_ni [protected] |
sampler-by-sampler breakdown of number of samples
Definition at line 172 of file MultipleImportanceSampler.h.
weight computation for individual samples (see init())
Definition at line 175 of file MultipleImportanceSampler.h.
union { ... } [protected] |
The documentation for this class was generated from the following files:
Generated on 28 Feb 2009 for Milton by
1.5.6