Skip to content

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

@Joll123

Description

@Joll123

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)));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions