mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2025-01-05 02:22:21 +03:00
89 lines
1.9 KiB
C++
89 lines
1.9 KiB
C++
/*
|
|
* System.h
|
|
*
|
|
* Created on: 23 Oct 2015
|
|
* Author: hieu
|
|
*/
|
|
|
|
#pragma once
|
|
#include <vector>
|
|
#include <deque>
|
|
#include <boost/thread/tss.hpp>
|
|
#include <boost/pool/object_pool.hpp>
|
|
#include "FF/FeatureFunctions.h"
|
|
#include "Weights.h"
|
|
#include "MemPool.h"
|
|
#include "Recycler.h"
|
|
#include "legacy/FactorCollection.h"
|
|
#include "legacy/Parameter.h"
|
|
#include "TypeDef.h"
|
|
#include "legacy/Bitmaps.h"
|
|
#include "legacy/OutputCollector.h"
|
|
|
|
namespace Moses2
|
|
{
|
|
namespace NSCubePruning
|
|
{
|
|
class Stack;
|
|
}
|
|
|
|
class FeatureFunction;
|
|
class StatefulFeatureFunction;
|
|
class PhraseTable;
|
|
class Hypothesis;
|
|
|
|
class System {
|
|
public:
|
|
const Parameter ¶ms;
|
|
FeatureFunctions featureFunctions;
|
|
Weights weights;
|
|
std::vector<const PhraseTable*> mappings;
|
|
mutable OutputCollector bestCollector;
|
|
|
|
// moses.ini params
|
|
size_t stackSize;
|
|
int maxDistortion;
|
|
size_t maxPhraseLength;
|
|
int numThreads;
|
|
|
|
SearchAlgorithm searchAlgorithm;
|
|
size_t popLimit;
|
|
size_t cubePruningDiversity;
|
|
bool cubePruningLazyScoring;
|
|
|
|
std::string outputFilePath;
|
|
size_t nbestSize;
|
|
bool onlyDistinct;
|
|
|
|
bool outputHypoScore;
|
|
int reportSegmentation;
|
|
int cpuAffinityOffset;
|
|
int cpuAffinityOffsetIncr;
|
|
|
|
System(const Parameter ¶msArg);
|
|
virtual ~System();
|
|
|
|
MemPool &GetSystemPool() const;
|
|
MemPool &GetManagerPool() const;
|
|
FactorCollection &GetVocab() const;
|
|
|
|
Recycler<Hypothesis*> &GetHypoRecycler() const;
|
|
ObjectPoolContiguous<Hypothesis*> &GetBatchForEval() const;
|
|
|
|
protected:
|
|
mutable FactorCollection m_vocab;
|
|
mutable boost::thread_specific_ptr<MemPool> m_managerPool;
|
|
mutable boost::thread_specific_ptr<MemPool> m_systemPool;
|
|
|
|
mutable boost::thread_specific_ptr< Recycler<Hypothesis*> > m_hypoRecycler;
|
|
mutable boost::thread_specific_ptr< ObjectPoolContiguous<Hypothesis*> > m_batchForEval;
|
|
|
|
void LoadWeights();
|
|
void LoadMappings();
|
|
|
|
void ini_performance_options();
|
|
};
|
|
|
|
}
|
|
|