Defines Interface for Implementations of Prediction Mechanism in Fast Branch and Bound & Branch and Bound with Partial Prediction.
More...
|
| virtual void | initialize (const DIMTYPE features)=0 |
| | (Re)initializes the predictor's per-feature state for features features; must be called before learn()/predict(), and again for every new search.
|
| virtual bool | learn (const DIMTYPE feature, const RETURNTYPE value)=0 |
| | Records an observed criterion value for feature, updating that feature's state only (see the class's per-feature isolation contract above).
|
| virtual bool | predict (const DIMTYPE feature, RETURNTYPE &value) const =0 |
| | Predicts feature's criterion value from its previously learn()ed observations, without evaluating the criterion.
|
| virtual std::ostream & | print (std::ostream &os) const |
| | writes a human-readable identification of the predictor's learned state; base default writes nothing
|
template<class RETURNTYPE, typename DIMTYPE>
class FST::Branch_And_Bound_Predictor< RETURNTYPE, DIMTYPE >
Defines Interface for Implementations of Prediction Mechanism in Fast Branch and Bound & Branch and Bound with Partial Prediction.
- Warning
- CONTRACT relied on by the threaded FBB/BBPP bodies: predictor state must be isolated per feature - predict(f) may read only state learned for feature f, and learn(f) may modify only feature f's state. FBB/BBPP decide predict-vs-compute for a whole tree level upfront on the master thread and replay the learns in candidate order after the batched evaluations; that upfront pass gives the same decisions as deciding one candidate at a time exactly because no feature's decision can observe another feature's same-level learn. A predictor that let features share state would make the two passes differ, and threaded runs would stop reproducing sequential ones - do not implement one against this interface.