diff options
author | philblunsom <philblunsom@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-08-23 18:19:53 +0000 |
---|---|---|
committer | philblunsom <philblunsom@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-08-23 18:19:53 +0000 |
commit | 8c2bc3d36e4773844fa829f568b2524345aba3be (patch) | |
tree | 0bdb11f272ab0aa754ae78c584e112da8afc8694 /gi/pyp-topics/src/pyp-topics.hh | |
parent | 485344fc8bceacaeec7272347b1eb2923738014b (diff) |
fixed llh and changed to random initialiser.
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@614 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'gi/pyp-topics/src/pyp-topics.hh')
-rw-r--r-- | gi/pyp-topics/src/pyp-topics.hh | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gi/pyp-topics/src/pyp-topics.hh b/gi/pyp-topics/src/pyp-topics.hh index ebe951b1..3a910540 100644 --- a/gi/pyp-topics/src/pyp-topics.hh +++ b/gi/pyp-topics/src/pyp-topics.hh @@ -17,7 +17,7 @@ class PYPTopics { public: typedef std::vector<int> DocumentTopics; typedef std::vector<DocumentTopics> CorpusTopics; - typedef double F; + typedef long double F; public: PYPTopics(int num_topics, bool use_topic_pyp=false, unsigned long seed = 0, @@ -31,9 +31,10 @@ public: void sample_corpus(const Corpus& corpus, int samples, int freq_cutoff_start=0, int freq_cutoff_end=0, int freq_cutoff_interval=0, - int max_contexts_per_document=0); + int max_contexts_per_document=0, + F temp_start=1.0, F temp_end=1.0); - int sample(const DocumentId& doc, const Term& term); + int sample(const DocumentId& doc, const Term& term, F inv_temp=1.0); std::pair<int,F> max(const DocumentId& doc, const Term& term) const; std::pair<int,F> max(const DocumentId& doc) const; int max_topic() const; @@ -54,6 +55,8 @@ public: void decrement(const Term& term, int topic, int level=0); void increment(const Term& term, int topic, int level=0); + F log_likelihood() const; + std::ostream& print_document_topics(std::ostream& out) const; std::ostream& print_topic_terms(std::ostream& out) const; |