#include <GDistribution.h>
|
| GCategoricalSamplerBatch (size_t categories, const GVec &distribution, GRand &rand) |
| categories specifies the number of categories. distribution should specify a probability value for each category. They should sum to 1. pDistribution is expected to remain valid for the duration of this object. More...
|
|
| ~GCategoricalSamplerBatch () |
|
void | draw (size_t samples, size_t *pOutBatch) |
| This will draw a batch of samples from the categorical distribution. This method is implemented efficiently, such that it will draw them in O(samples + categories) time. (This is significantly faster than O(samples * log(categories)) time, which is what you get if you use GCategoricalSampler.) More...
|
|
GClasses::GCategoricalSamplerBatch::GCategoricalSamplerBatch |
( |
size_t |
categories, |
|
|
const GVec & |
distribution, |
|
|
GRand & |
rand |
|
) |
| |
categories specifies the number of categories. distribution should specify a probability value for each category. They should sum to 1. pDistribution is expected to remain valid for the duration of this object.
GClasses::GCategoricalSamplerBatch::~GCategoricalSamplerBatch |
( |
| ) |
|
void GClasses::GCategoricalSamplerBatch::draw |
( |
size_t |
samples, |
|
|
size_t * |
pOutBatch |
|
) |
| |
This will draw a batch of samples from the categorical distribution. This method is implemented efficiently, such that it will draw them in O(samples + categories) time. (This is significantly faster than O(samples * log(categories)) time, which is what you get if you use GCategoricalSampler.)
static void GClasses::GCategoricalSamplerBatch::test |
( |
| ) |
|
|
static |
size_t GClasses::GCategoricalSamplerBatch::m_categories |
|
protected |
const GVec& GClasses::GCategoricalSamplerBatch::m_distribution |
|
protected |