21 template <
bool is_learn>
29 if (known_cost !=
nullptr && index == known_cost->
action)
32 simple_temp.
label = FLT_MAX;
38 if (is_learn && known_cost !=
nullptr && index == known_cost->
action)
40 float old_weight = ec.
weight;
42 scorer->
learn(ec, index - 1 + base);
46 scorer->
predict(ec, index - 1 + base);
48 if (!baseline_enabled_old)
60 if (action == observation->
action)
67 for (
auto& cl : scores.
costs)
68 if (cl.class_index == action)
76 return (cost - offset) / a_s.
score;
bool example_is_newline_not_header(example const &ec)
void predict(E &ec, size_t i=0)
bool ec_is_example_header(example const &ec)
void set_baseline_enabled(example *ec)
float get_cost_estimate(CB::cb_class *observation, uint32_t action, float offset=0.)
int example_is_newline(example const &ec)
LEARNER::base_learner * cb_algs_setup(VW::config::options_i &options, vw &all)
float get_cost_pred(LEARNER::single_learner *scorer, CB::cb_class *known_cost, example &ec, uint32_t index, uint32_t base)
void reset_baseline_disabled(example *ec)
void learn(E &ec, size_t i=0)
bool baseline_enabled(example *ec)