diff options
Diffstat (limited to 'contrib/moses2/Weights.h')
-rw-r--r-- | contrib/moses2/Weights.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/contrib/moses2/Weights.h b/contrib/moses2/Weights.h new file mode 100644 index 000000000..d822ff923 --- /dev/null +++ b/contrib/moses2/Weights.h @@ -0,0 +1,41 @@ +/* + * Weights.h + * + * Created on: 24 Oct 2015 + * Author: hieu + */ +#pragma once + +#include <iostream> +#include <vector> +#include "TypeDef.h" + +namespace Moses2 +{ + +class FeatureFunctions; + +class Weights +{ +public: + Weights(); + virtual ~Weights(); + void Init(const FeatureFunctions &ffs); + + SCORE operator[](size_t ind) const + { + return m_weights[ind]; + } + + std::ostream &Debug(std::ostream &out, const System &system) const; + + std::vector<SCORE> GetWeights(const FeatureFunction &ff) const; + + void SetWeights(const FeatureFunctions &ffs, const std::string &ffName, const std::vector<float> &weights); + +protected: + std::vector<SCORE> m_weights; +}; + +} + |