Lines 53-62
Link Here
|
53 |
typedef std::map<float, int> RealIndexMap; // map real values to their indices |
53 |
typedef std::map<float, int> RealIndexMap; // map real values to their indices |
54 |
typedef std::map<std::string, unsigned int> TLexicon; // map word to wid |
54 |
typedef std::map<std::string, unsigned int> TLexicon; // map word to wid |
55 |
|
55 |
|
56 |
#define EffectivePr(a) (float((usingLogPr) ? ((a) / log(2.0)) : (-log2((a))))) |
56 |
#define EffectivePr(a) (float((usingLogPr) ? ((a) / logf(2.0f)) : (-log2f((a))))) |
57 |
#define OriginalPr(b) (float((usingLogPr) ? ((b) * log(2.0)) : (exp2(-(b))))) |
57 |
#define OriginalPr(b) (float((usingLogPr) ? ((b) * logf(2.0f)) : (exp2f(-(b))))) |
58 |
#define EffectiveBow(a) (float((usingLogPr) ? (exp(-(a))) : ((a)))) |
58 |
#define EffectiveBow(a) (float((usingLogPr) ? (expf(-(a))) : ((a)))) |
59 |
#define OriginalBow(b) (float((usingLogPr) ? (-log((b))) : ((b)))) |
59 |
#define OriginalBow(b) (float((usingLogPr) ? (-logf((b))) : ((b)))) |
60 |
|
60 |
|
61 |
#endif //_SLM_PACK_COMMON_H |
61 |
#endif //_SLM_PACK_COMMON_H |
62 |
|
62 |
|