summaryrefslogtreecommitdiff
path: root/dtrain/sample_hg.h
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2011-09-09 09:51:09 +0200
committerPatrick Simianer <p@simianer.de>2011-09-23 19:13:58 +0200
commit2e6ef7cbec77b22ce3d64416a5ada3a6c081f9e2 (patch)
tree13c2013947ed643889811b82c93d434835b05252 /dtrain/sample_hg.h
parent14637f89c899179f54a5bc327857db8ea1e1d427 (diff)
forgotten files
Diffstat (limited to 'dtrain/sample_hg.h')
-rw-r--r--dtrain/sample_hg.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/dtrain/sample_hg.h b/dtrain/sample_hg.h
new file mode 100644
index 00000000..932fd369
--- /dev/null
+++ b/dtrain/sample_hg.h
@@ -0,0 +1,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