2015-10-24 16:36:30 +03:00
|
|
|
/*
|
|
|
|
* Weights.h
|
|
|
|
*
|
|
|
|
* Created on: 24 Oct 2015
|
|
|
|
* Author: hieu
|
|
|
|
*/
|
2016-06-18 01:06:02 +03:00
|
|
|
#pragma once
|
2015-10-24 16:36:30 +03:00
|
|
|
|
2015-10-26 19:32:47 +03:00
|
|
|
#include <iostream>
|
2015-10-29 21:15:12 +03:00
|
|
|
#include <vector>
|
2015-10-24 16:36:30 +03:00
|
|
|
#include "TypeDef.h"
|
|
|
|
|
2015-12-10 23:49:30 +03:00
|
|
|
namespace Moses2
|
|
|
|
{
|
|
|
|
|
2015-10-27 20:35:42 +03:00
|
|
|
class FeatureFunctions;
|
|
|
|
|
2016-03-31 23:00:16 +03:00
|
|
|
class Weights
|
|
|
|
{
|
2015-10-24 16:36:30 +03:00
|
|
|
public:
|
2015-10-27 20:35:42 +03:00
|
|
|
Weights();
|
|
|
|
virtual ~Weights();
|
2015-10-29 21:15:12 +03:00
|
|
|
void Init(const FeatureFunctions &ffs);
|
2015-10-27 20:35:42 +03:00
|
|
|
|
2016-03-31 23:00:16 +03:00
|
|
|
SCORE operator[](size_t ind) const
|
|
|
|
{
|
|
|
|
return m_weights[ind];
|
2015-10-27 20:35:42 +03:00
|
|
|
}
|
2015-10-24 16:36:30 +03:00
|
|
|
|
2016-06-18 01:06:02 +03:00
|
|
|
std::ostream &Debug(std::ostream &out, const System &system) const;
|
2015-10-29 21:15:12 +03:00
|
|
|
|
2015-10-27 20:35:42 +03:00
|
|
|
void CreateFromString(const FeatureFunctions &ffs, const std::string &line);
|
2015-10-24 16:36:30 +03:00
|
|
|
|
2016-08-11 16:24:32 +03:00
|
|
|
std::vector<SCORE> GetWeights(const FeatureFunction &ff) const;
|
|
|
|
|
2015-10-29 21:15:12 +03:00
|
|
|
protected:
|
|
|
|
std::vector<SCORE> m_weights;
|
2015-10-24 16:36:30 +03:00
|
|
|
};
|
|
|
|
|
2015-12-10 23:49:30 +03:00
|
|
|
}
|
|
|
|
|