summaryrefslogtreecommitdiff
path: root/decoder/ff.h
diff options
context:
space:
mode:
authorgraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-21 22:09:50 +0000
committergraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-21 22:09:50 +0000
commit8700e2ee96a71ed267617ce1ebd4ef3a002a1f6c (patch)
treefa4bb7fd70fbd422a3a7a9564fa8ba86aff2797f /decoder/ff.h
parentc9416968b391f10891733a00cc57bda27b4d323d (diff)
disabled TD reserved stuff - debug init assertion later
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@364 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'decoder/ff.h')
-rw-r--r--decoder/ff.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/decoder/ff.h b/decoder/ff.h
index 2cf96d39..2b7c7fec 100644
--- a/decoder/ff.h
+++ b/decoder/ff.h
@@ -46,8 +46,8 @@ public:
inline void TraversalFeatures(const SentenceMetadata& smeta,
const Hypergraph::Edge& edge,
const std::vector<const void*>& ant_contexts,
- SparseVector<double>* features,
- SparseVector<double>* estimated_features,
+ FeatureVector* features,
+ FeatureVector* estimated_features,
void* out_state) const {
TraversalFeaturesImpl(smeta, edge, ant_contexts,
features, estimated_features, out_state);
@@ -62,7 +62,7 @@ public:
// it here. For example, the language model computes the cost of adding
// <s> and </s>.
virtual void FinalTraversalFeatures(const void* residual_state,
- SparseVector<double>* final_features) const;
+ FeatureVector* final_features) const;
protected:
// context is a pointer to a buffer of size NumBytesContext() that the
@@ -75,15 +75,15 @@ public:
virtual void TraversalFeaturesImpl(const SentenceMetadata& smeta,
const Hypergraph::Edge& edge,
const std::vector<const void*>& ant_contexts,
- SparseVector<double>* features,
- SparseVector<double>* estimated_features,
+ FeatureVector* features,
+ FeatureVector* estimated_features,
void* context) const = 0;
// !!! ONLY call this from subclass *CONSTRUCTORS* !!!
void SetStateSize(size_t state_size) {
state_size_ = state_size;
}
-
+ int StateSize() const { return state_size_; }
private:
int state_size_;
};
@@ -102,8 +102,8 @@ class WordPenalty : public FeatureFunction {
virtual void TraversalFeaturesImpl(const SentenceMetadata& smeta,
const Hypergraph::Edge& edge,
const std::vector<const void*>& ant_contexts,
- SparseVector<double>* features,
- SparseVector<double>* estimated_features,
+ FeatureVector* features,
+ FeatureVector* estimated_features,
void* context) const;
private:
const int fid_;
@@ -122,8 +122,8 @@ class SourceWordPenalty : public FeatureFunction {
virtual void TraversalFeaturesImpl(const SentenceMetadata& smeta,
const Hypergraph::Edge& edge,
const std::vector<const void*>& ant_contexts,
- SparseVector<double>* features,
- SparseVector<double>* estimated_features,
+ FeatureVector* features,
+ FeatureVector* estimated_features,
void* context) const;
private:
const int fid_;
@@ -148,8 +148,8 @@ class ArityPenalty : public FeatureFunction {
virtual void TraversalFeaturesImpl(const SentenceMetadata& smeta,
const Hypergraph::Edge& edge,
const std::vector<const void*>& ant_contexts,
- SparseVector<double>* features,
- SparseVector<double>* estimated_features,
+ FeatureVector* features,
+ FeatureVector* estimated_features,
void* context) const;
private:
std::vector<WordID> fids_;