mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-11 11:25:40 +03:00
Replace M_LN10 altogether. Not entirely standard.
This commit is contained in:
parent
8bbbc0670d
commit
a66056cd39
@ -214,12 +214,21 @@ Manager::Manager(ttasksptr const& ttask)
|
||||
Manager::~Manager()
|
||||
{ }
|
||||
|
||||
|
||||
namespace
|
||||
{
|
||||
// Natural logarithm of 10.
|
||||
//
|
||||
// Some implementations of <cmath> define M_LM10, but not all.
|
||||
const float log_10 = logf(10);
|
||||
}
|
||||
|
||||
template <class Model, class Best> search::History Manager::PopulateBest(const Model &model, const std::vector<lm::WordIndex> &words, Best &out)
|
||||
{
|
||||
const LanguageModel &abstract = LanguageModel::GetFirstLM();
|
||||
const float oov_weight = abstract.OOVFeatureEnabled() ? abstract.GetOOVWeight() : 0.0;
|
||||
const StaticData &data = StaticData::Instance();
|
||||
search::Config config(abstract.GetWeight() * M_LN10, data.GetCubePruningPopLimit(), search::NBestConfig(data.GetNBestSize()));
|
||||
search::Config config(abstract.GetWeight() * log_10, data.GetCubePruningPopLimit(), search::NBestConfig(data.GetNBestSize()));
|
||||
search::Context<Model> context(config, model);
|
||||
|
||||
size_t size = m_source.GetSize();
|
||||
|
Loading…
Reference in New Issue
Block a user