diff options
author | Chris Dyer <redpony@gmail.com> | 2014-12-17 15:03:48 -0500 |
---|---|---|
committer | Chris Dyer <redpony@gmail.com> | 2014-12-17 15:03:48 -0500 |
commit | 796768086a687d3f1856fef6489c34fe4d373642 (patch) | |
tree | 154a46bf784107f5abdc77f2bd4f10b287b623f7 /decoder/ffset.h | |
parent | c915af2347a676b1f3b11dc4c0865c4bdb7ca609 (diff) | |
parent | 0bf82a2b969c8022bd5ad490b28a2df27e03e919 (diff) |
Merge pull request #61 from kho/ignore_state
Add IgnoredStateSize() to FeatureFunction
Diffstat (limited to 'decoder/ffset.h')
-rw-r--r-- | decoder/ffset.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/decoder/ffset.h b/decoder/ffset.h index b7322ee2..84f9fdb9 100644 --- a/decoder/ffset.h +++ b/decoder/ffset.h @@ -1,6 +1,7 @@ #ifndef FFSET_H_ #define FFSET_H_ +#include <utility> #include <vector> #include "value_array.h" #include "prob.h" @@ -47,11 +48,18 @@ class ModelSet { bool stateless() const { return !state_size_; } + // Part of a feature state may be used for storing some side data for + // calculating feature values but not necessary for splitting hypernodes. Such + // bytes needs to be erased for hypernode splitting. + bool NeedsStateErasure() const; + void EraseIgnoredBytes(FFState* state) const; + private: std::vector<const FeatureFunction*> models_; const std::vector<double>& weights_; int state_size_; std::vector<int> model_state_pos_; + std::vector<std::pair<int, int> > ranges_to_erase_; }; #endif |