summaryrefslogtreecommitdiff
path: root/dtrain/hgsampler.h
blob: 45c5b8f2058cb283b0a42e3d7b983080e7dd8afb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Chris Dyer
#ifndef _DTRAIN_HGSAMPLER_H_
#define _DTRAIN_HGSAMPLER_H_


#include <vector>
#include "sparse_vector.h"
#include "sampler.h"
#include "wordid.h"

class Hypergraph;

struct HypergraphSampler {

  struct Hypothesis {
    std::vector<WordID> words;
    SparseVector<double> fmap;
    prob_t model_score;
  };

  static void
  sample_hypotheses(const Hypergraph& hg,
                    unsigned n,
                    MT19937* rng,
                    std::vector<Hypothesis>* hypos);
};


#endif