summaryrefslogtreecommitdiff
path: root/gi/clda/src/clda.cc
diff options
context:
space:
mode:
authorredpony <redpony@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-06-25 01:45:03 +0000
committerredpony <redpony@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-06-25 01:45:03 +0000
commit595ab284eef74e540f1e4aef7458a0cf6790482d (patch)
tree865c1d5de91e363b50d77d59c4bfd0bf15d312ac /gi/clda/src/clda.cc
parent60a7aa278e9d24e0927fabf12581e8b36b774a2c (diff)
optionally use unlimited cache
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@27 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'gi/clda/src/clda.cc')
-rw-r--r--gi/clda/src/clda.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gi/clda/src/clda.cc b/gi/clda/src/clda.cc
index 05cbb441..efe666e2 100644
--- a/gi/clda/src/clda.cc
+++ b/gi/clda/src/clda.cc
@@ -61,13 +61,13 @@ int main(int argc, char** argv) {
double alpha = 50.0 / num_classes;
vector<CRP<int> > dr(zji.size(), CRP<int>(beta)); // dr[i] describes the probability of using a topic in document i
vector<CRP<int> > wr(num_classes, CRP<int>(alpha)); // wr[k] describes the probability of generating a word in topic k
- int random_topic = rng.next() * num_classes;
for (int j = 0; j < zji.size(); ++j) {
const size_t num_words = wji[j].size();
vector<int>& zj = zji[j];
const vector<int>& wj = wji[j];
zj.resize(num_words);
for (int i = 0; i < num_words; ++i) {
+ int random_topic = rng.next() * num_classes;
if (random_topic == num_classes) { --random_topic; }
zj[i] = random_topic;
const int word = wj[i];