Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix #4669 by handling empty decision scores elements #4670

Merged
merged 10 commits into from
Feb 27, 2024

Conversation

jackgerrits
Copy link
Member

Closes #4669

@@ -0,0 +1,50 @@
ccb shared |User userID='aUser'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't we use simpler example here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I opted to add the test as is from the issue, I can add the simplified example with a -p too

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going back on that. Updated the test to use your example.

@@ -26,7 +26,8 @@ void print_update(VW::workspace& all, const VW::multi_ex& slots, const VW::decis
std::string delim;
for (const auto& slot : decision_scores)
{
pred_ss << delim << slot[0].action;
if (slot.empty()) { pred_ss << delim << "None"; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we add -p to test?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added it, it shows how suboptimal the empty line is. there's no way to distinguish between it and separators really... (apart from the fact you know two in sequence must be an empty action probs)

@@ -547,6 +552,10 @@ void update_stats_ccb(const VW::workspace& /* all */, shared_data& sd, const ccb
num_labeled++;
if (i == 0 || data.all_slots_loss_report)
{
// It is possible for the prediction to be empty if there were no actions available at the time of taking the
// slot decision. In this case it does not contribute to loss.
if (preds[i].empty()) { continue; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we also exclude this example from denominator? (num_labeled--)

@ataymano
Copy link
Member

@jackgerrits , looks like new warning should be added to .stdout files

@jackgerrits jackgerrits reopened this Feb 27, 2024
@jackgerrits jackgerrits enabled auto-merge (squash) February 27, 2024 16:57
@jackgerrits jackgerrits merged commit 8e4cb19 into VowpalWabbit:master Feb 27, 2024
223 checks passed
@jackgerrits jackgerrits deleted the fix/issue4669 branch February 27, 2024 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Segfault on ccb_explore_adf -cb_type dr
2 participants