Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHieu Hoang <hieuhoang@gmail.com>2017-02-01 01:21:59 +0300
committerHieu Hoang <hieuhoang@gmail.com>2017-02-01 01:21:59 +0300
commita8a5b43f2dc32bd1b45006fd43989dc71e74ba0e (patch)
treee84a78fa005e29ec78076d6e525371240871122c /moses2/Weights.h
parent7206d592751ee9afeb1fa4753b7e19272e2585bc (diff)
move moses2 to root
Diffstat (limited to 'moses2/Weights.h')
-rw-r--r--moses2/Weights.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/moses2/Weights.h b/moses2/Weights.h
new file mode 100644
index 000000000..c3c2cee62
--- /dev/null
+++ b/moses2/Weights.h
@@ -0,0 +1,39 @@
+/*
+ * 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::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;
+};
+
+}
+