PineForge HPO 0.1.0
Native hyperparameter optimization for PineForge strategies
Loading...
Searching...
No Matches
pineforge::hpo::RandomSampler Class Referencefinal

Seeded independent sampler with replacement. More...

#include <pineforge/hpo/sampler.hpp>

+ Inheritance diagram for pineforge::hpo::RandomSampler:

Public Member Functions

 RandomSampler (SearchSpace space, std::uint64_t seed, std::uint64_t max_candidates=0)
 Constructs a random sampler; max_candidates == 0 means unbounded generation.
 
std::optional< Candidatenext () override
 Samples one independent candidate, or returns std::nullopt at the configured limit.
 
void reset () override
 Reseeds the generator and restores the original sequence.
 
std::uint64_t generated () const noexcept override
 Returns the number of candidates issued since construction or reset.
 
std::uint64_t seed () const noexcept
 Returns the reproducibility seed.
 
- Public Member Functions inherited from pineforge::hpo::Sampler
virtual ~Sampler ()=default
 

Detailed Description

Seeded independent sampler with replacement.

RandomSampler is deterministic for a fixed search space, seed, and call sequence. It does not learn from objective values and does not guarantee unique candidates.

Definition at line 51 of file sampler.hpp.

Constructor & Destructor Documentation

◆ RandomSampler()

pineforge::hpo::RandomSampler::RandomSampler ( SearchSpace  space,
std::uint64_t  seed,
std::uint64_t  max_candidates = 0 
)

Constructs a random sampler; max_candidates == 0 means unbounded generation.

Member Function Documentation

◆ generated()

std::uint64_t pineforge::hpo::RandomSampler::generated ( ) const
inlineoverridevirtualnoexcept

Returns the number of candidates issued since construction or reset.

Implements pineforge::hpo::Sampler.

Definition at line 61 of file sampler.hpp.

◆ next()

std::optional< Candidate > pineforge::hpo::RandomSampler::next ( )
overridevirtual

Samples one independent candidate, or returns std::nullopt at the configured limit.

Implements pineforge::hpo::Sampler.

◆ reset()

void pineforge::hpo::RandomSampler::reset ( )
overridevirtual

Reseeds the generator and restores the original sequence.

Implements pineforge::hpo::Sampler.

◆ seed()

std::uint64_t pineforge::hpo::RandomSampler::seed ( ) const
inlinenoexcept

Returns the reproducibility seed.

Definition at line 63 of file sampler.hpp.


The documentation for this class was generated from the following file: