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

Why does the sampling result need to be multiplied by 256? #139

Open
Joll123 opened this issue Feb 3, 2024 · 0 comments
Open

Why does the sampling result need to be multiplied by 256? #139

Joll123 opened this issue Feb 3, 2024 · 0 comments

Comments

@Joll123
Copy link

Joll123 commented Feb 3, 2024

Hi, in project_and_sample.h of Lyra-0.0.2-release, why does the sampling result be multipled by 256?
float f_result = mean + scale * log((1.0f - prob) / prob);
int result = std::min(static_cast(std::numeric_limits<int16_t>::max()),
std::max(static_cast(std::numeric_limits<int16_t>::min()),
static_cast(f_result * 256)));

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

1 participant