summaryrefslogtreecommitdiff
path: root/dtrain/sample_hg.h
blob: 932fd369e46c5ab89b4e9e49ca1c05d051228547 (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
#ifndef _SAMPLE_HG_H_
#define _SAMPLE_HG_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