diff options
author | Peng Wu <alexepico@gmail.com> | 2011-07-29 11:47:56 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2011-07-29 11:47:56 +0800 |
commit | 2f1e4e17542d7e91261e8d05321b2886fbe38298 (patch) | |
tree | e4cebe37b250b7a002b6c1b4b28394dca2ff9df3 /utils/training/k_mixture_model.h | |
parent | 1eb686be6f2ff7692fd4ba4fee58c19436710340 (diff) | |
download | libpinyin-2f1e4e17542d7e91261e8d05321b2886fbe38298.tar.gz libpinyin-2f1e4e17542d7e91261e8d05321b2886fbe38298.tar.xz libpinyin-2f1e4e17542d7e91261e8d05321b2886fbe38298.zip |
fixes prune tool
Diffstat (limited to 'utils/training/k_mixture_model.h')
-rw-r--r-- | utils/training/k_mixture_model.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/utils/training/k_mixture_model.h b/utils/training/k_mixture_model.h index 2d9816b..6e48796 100644 --- a/utils/training/k_mixture_model.h +++ b/utils/training/k_mixture_model.h @@ -56,8 +56,10 @@ static inline parameter_t compute_B(corpus_count_t N, corpus_count_t n_1){ /* Note: re-check this, to see if we can remove if statement. */ /* Please consider B_2 is no less than 2 in paper. */ +#if 0 if ( 0 == T - n_1 && 0 == N - n_0 - n_1 ) return 2; +#endif parameter_t B = (T - n_1 ) / (parameter_t) (N - n_0 - n_1); return B; @@ -75,7 +77,7 @@ static inline parameter_t compute_Pr_G_3(corpus_count_t k, return alpha * (1 - gamma); if ( k > 1 ) { - return alpha * gamma / (B - 1) * pow((1 - 1 / (B - 1)) , k - 2); + return (alpha * gamma / (B - 1)) * pow((1 - 1 / (B - 1)) , k - 2); } assert(false); |