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

Unnecessary assert in prioritized selector #135

Open
abagaria opened this issue Oct 17, 2023 · 1 comment
Open

Unnecessary assert in prioritized selector #135

abagaria opened this issue Oct 17, 2023 · 1 comment

Comments

@abagaria
Copy link

@samlobel and I are trying to create a replay table with prioritized sampler and remover. We are trying to remove low priority entries by negating the priority_exponent argument to the remover's constructor (the priority_exponent converts the priority scores to probabilities by raising the score to the exponent and dividing by the sum of scores raised to exponent). However, there is an assert in the cpp constructor for the remover selector that prevents us from specifying negative priority_exponents, even though this is a totally valid mathematical operation which would continue to yield valid sampling/removing probabilities. Here is an example culprit assert of code:

REVERB_CHECK_GE(priority_exponent_, 0);
.

Would it be possible to remove that assert statement? Alternatively, is there a workaround?

@acassirer
Copy link
Collaborator

Hey,

Yes we can go ahead and remove this restriction. I don't even remember the reasoning behind it to begin with.

The change will be submitted today and will be part of the next Reverb release (which is coupled with the next tensorflow release). In the meantime I'd suggest you build Reverb from source with this change included.

copybara-service bot pushed a commit that referenced this issue Oct 18, 2023
#135

PiperOrigin-RevId: 574426193
Change-Id: I61ee2677b92365c3fb972ea39e8542a9a964ed98
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

No branches or pull requests

2 participants