1 #ifndef __ZGEN_BESTFIRST_LEARNING_LEARNER_H__
2 #define __ZGEN_BESTFIRST_LEARNING_LEARNER_H__
68 bool test_convergence(
int nr_gold_spans,
const SpanSet& gold_spans);
78 void learn_one_iteration();
85 void load_sortedlist_from_agenda(
SpanMaxHeap& agenda);
92 void load_agenda_from_sortedlist(
SpanMaxHeap& agenda);
99 void load_agenda_from_sortedlist(
const SpanSet& gold_spans,
107 int count_number_of_gold_spans_in_sortedlist(
const SpanSet& gold_spans);
118 int collect_positive_spans(
int nr_gold_spans,
130 int collect_negative_spans(
int nr_gold_spans,
138 void increase_positive_spans(
const std::vector<Span*>& positive_spans);
144 void decrease_negative_spans(
const std::vector<Span*>& negative_spans);
151 void score_spans_in_sortedlist();
157 std::vector<Span *> positive_spans;
158 std::vector<Span *> negative_spans;
159 std::vector<Span *> sorted_span_list;
166 #endif // end for __ZGEN_BESTFIRST_LEARNING_PERCEPTRON__
void config_model(Model *model)
boost::unordered_set< Span *, SpanPtrHash, SpanPtrEqual > SpanSet
Definition: span_types.h:12
boost::heap::priority_queue< Span *, boost::heap::compare< SpanPtrLess > > SpanMaxHeap
Definition: span_types.h:14
int learn(const SpanSet &gold_spans, SpanMaxHeap &agenda)
Definition: learner.cc:26
void config_timestamp(int timestamp)
Definition: learner.cc:20
Learner(Model *model, int max_iteration=1)
Definition: learner.cc:11