Skip to content

Commit

Permalink
no binary stuff in boosting (#4611)
Browse files Browse the repository at this point in the history
  • Loading branch information
ataymano authored Sep 1, 2023
1 parent bea6816 commit dfef808
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
2 changes: 1 addition & 1 deletion vowpalwabbit/core/src/reduction_stack.cc
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,12 @@ void prepare_reductions(std::vector<std::tuple<std::string, VW::reduction_setup_

// Reductions
reductions.push_back(VW::reductions::bs_setup);
reductions.push_back(VW::reductions::boosting_setup);
reductions.push_back(VW::reductions::binary_setup);

reductions.push_back(VW::reductions::expreplay_setup<'m', VW::multiclass_label_parser_global>);
reductions.push_back(VW::reductions::topk_setup);
reductions.push_back(VW::reductions::oaa_setup);
reductions.push_back(VW::reductions::boosting_setup);
reductions.push_back(VW::reductions::ect_setup);
reductions.push_back(VW::reductions::log_multi_setup);
reductions.push_back(VW::reductions::recall_tree_setup);
Expand Down
18 changes: 3 additions & 15 deletions vowpalwabbit/core/src/reductions/boosting.cc
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,7 @@ void predict_or_learn(boosting& o, VW::LEARNER::learner& base, VW::example& ec)
}

ec.weight = u;
ec.partial_prediction = final_prediction;
ec.pred.scalar = VW::math::sign(final_prediction);

if (ld.label == ec.pred.scalar) { ec.loss = 0.; }
else { ec.loss = ec.weight; }
ec.pred.scalar = final_prediction;
}

//-----------------------------------------------------------------
Expand Down Expand Up @@ -166,11 +162,7 @@ void predict_or_learn_logistic(boosting& o, VW::LEARNER::learner& base, VW::exam
}

ec.weight = u;
ec.partial_prediction = final_prediction;
ec.pred.scalar = VW::math::sign(final_prediction);

if (ld.label == ec.pred.scalar) { ec.loss = 0.; }
else { ec.loss = ec.weight; }
ec.pred.scalar = final_prediction;
}

template <bool is_learn>
Expand Down Expand Up @@ -244,11 +236,7 @@ void predict_or_learn_adaptive(boosting& o, VW::LEARNER::learner& base, VW::exam
}

ec.weight = u;
ec.partial_prediction = final_prediction;
ec.pred.scalar = VW::math::sign(final_prediction);

if (ld.label == ec.pred.scalar) { ec.loss = 0.; }
else { ec.loss = ec.weight; }
ec.pred.scalar = final_prediction;
}

void save_load_sampling(boosting& o, VW::io_buf& model_file, bool read, bool text)
Expand Down

0 comments on commit dfef808

Please sign in to comment.