MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / LogUniformSampler

Method LogUniformSampler

paddle/phi/kernels/funcs/math/sampler.cc:35–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33float UniformSampler::Probability(int64_t value) const { return inv_range_; }
34
35LogUniformSampler::LogUniformSampler(int64_t range, unsigned int seed)
36 : Sampler(range, seed), log_range_(log(range + 1)) { // NOLINT
37 random_engine_ = phi::GetCPURandomEngine(seed_);
38 dist_ = std::make_shared<std::uniform_real_distribution<>>(0, 1);
39}
40
41int64_t LogUniformSampler::Sample() const {
42 // Got Log Uniform distribution from uniform distribution by

Callers

nothing calls this directly

Calls 2

GetCPURandomEngineFunction · 0.85
logFunction · 0.50

Tested by

no test coverage detected