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

Implement the core reduction for slates #2347

Merged

Conversation

jackgerrits
Copy link
Member

  • Tested using a mock base reduction and asserting the required transformation takes place
    • This is a new way of testing we haven't done before, and I think it could be a great way to build robust and localized tests going forward
  • Small refactor to the way CCB prints its decision scores as slates needed to reuse that logic
  • Extracted out decision scores into its own header for reuse
  • First implementation of reduction, there are opportunities for optimization but with refactors looming it's questionable how valuable it is to do that now vs later

vowpalwabbit/conditional_contextual_bandit.cc Outdated Show resolved Hide resolved
vowpalwabbit/conditional_contextual_bandit.cc Show resolved Hide resolved
vowpalwabbit/conditional_contextual_bandit.h Outdated Show resolved Hide resolved
vowpalwabbit/decision_scores.cc Outdated Show resolved Hide resolved
vowpalwabbit/slates.cc Show resolved Hide resolved
vowpalwabbit/slates.h Show resolved Hide resolved
vowpalwabbit/slates.cc Show resolved Hide resolved
vowpalwabbit/slates.cc Outdated Show resolved Hide resolved
}
else if (slates_label.type == slates::example_type::action)
{
if (slates_label.slot_id >= num_slots)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Documentation says that std::count_if() returns a signed int. I'm not sure if its possible to actually get a negative in this case, but something to be aware of

Copy link
Member Author

Choose a reason for hiding this comment

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

It's assigned into a size_t above. While in the docs it is a difference type it also says:

"number of elements satisfying the condition.

That's a pretty annoying API...

@jackgerrits jackgerrits merged commit 0a00717 into VowpalWabbit:master Apr 6, 2020
@jackgerrits jackgerrits deleted the jagerrit/slates_reduction branch April 15, 2021 12:49
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.

None yet

2 participants