19 virtual std::optional<Candidate>
next() = 0;
23 virtual std::uint64_t
generated() const noexcept = 0;
33 std::optional<Candidate>
next()
override;
37 std::uint64_t
generated() const noexcept
override {
return generated_; }
43 std::uint64_t total_candidates_ = 0;
44 std::uint64_t generated_ = 0;
57 std::optional<Candidate>
next()
override;
61 std::uint64_t
generated() const noexcept
override {
return generated_; }
63 std::uint64_t
seed() const noexcept {
return seed_; }
68 std::uint64_t max_candidates_;
69 std::uint64_t generated_ = 0;
70 std::mt19937_64 engine_;
95 std::uint64_t startup_trials = 10;
101 std::uint64_t ei_candidates = 24;
104 double gamma_fraction = 0.10;
109 std::uint64_t gamma_cap = 25;
112 double prior_weight = 1.0;
119 bool constant_liar =
true;
142 std::uint64_t max_candidates = 0,
162 void tell(std::uint64_t candidate_id,
double objective_value);
166 void abandon(std::uint64_t candidate_id);
172 void reset() override;
174 std::uint64_t generated() const noexcept override;
176 std::uint64_t completed() const noexcept;
178 std::uint64_t outstanding() const noexcept;
180 std::uint64_t duplicate_proposals_skipped() const noexcept;
182 std::uint64_t seed() const noexcept {
return seed_; }
196 std::uint64_t max_candidates_;
199 std::unique_ptr<Impl> impl_;
218 std::uint64_t max_candidates = 0);
236 void tell(std::uint64_t candidate_id,
double objective_value);
240 void abandon(std::uint64_t candidate_id);
243 void reset() override;
245 std::uint64_t generated() const noexcept override;
247 std::uint64_t completed() const noexcept;
249 std::uint64_t outstanding() const noexcept;
251 std::uint64_t seed() const noexcept {
return seed_; }
261 std::uint64_t max_candidates_;
262 std::unique_ptr<Impl> impl_;
Adaptive derivative-free optimizer backed by dlib::global_function_search.
DlibGlobalSampler(const DlibGlobalSampler &)=delete
DlibGlobalSampler & operator=(const DlibGlobalSampler &)=delete
~DlibGlobalSampler() override
DlibGlobalSampler(DlibGlobalSampler &&) noexcept
ObjectiveDirection direction() const noexcept
Returns the configured optimization direction.
DlibGlobalSampler(SearchSpace space, std::uint64_t seed, ObjectiveDirection direction=ObjectiveDirection::Maximize, std::uint64_t max_candidates=0)
Constructs a dlib global sampler; max_candidates == 0 means unbounded generation.
Lazy exhaustive sampler over a finite SearchSpace in mixed-radix order.
std::optional< Candidate > next() override
Returns each finite candidate once, then std::nullopt.
std::uint64_t total_candidates() const noexcept
Returns the exact finite search-space cardinality.
std::uint64_t generated() const noexcept override
Returns the number of candidates issued since construction or reset.
GridSampler(SearchSpace space)
void reset() override
Rewinds enumeration to ordinal zero.
Seeded independent sampler with replacement.
std::uint64_t seed() const noexcept
Returns the reproducibility seed.
void reset() override
Reseeds the generator and restores the original sequence.
std::optional< Candidate > next() override
Samples one independent candidate, or returns std::nullopt at the configured limit.
std::uint64_t generated() const noexcept override
Returns the number of candidates issued since construction or reset.
RandomSampler(SearchSpace space, std::uint64_t seed, std::uint64_t max_candidates=0)
Constructs a random sampler; max_candidates == 0 means unbounded generation.
Minimal pull-based interface shared by candidate samplers.
virtual std::uint64_t generated() const noexcept=0
Returns the number of candidates issued since construction or the last reset.
virtual std::optional< Candidate > next()=0
Returns the next candidate, or std::nullopt when the configured budget is exhausted.
virtual ~Sampler()=default
virtual void reset()=0
Restores the sampler's seeded initial state.
Ordered product of named dimensions with validation and finite-space codecs.
Independent, single-objective Tree-structured Parzen Estimator sampler.
TpeSampler(SearchSpace space, std::uint64_t seed, ObjectiveDirection direction=ObjectiveDirection::Maximize, std::uint64_t max_candidates=0, TpeSamplerConfig config={}, CandidatePolicy candidate_policy=CandidatePolicy::SamplerDefault)
Constructs a native TPE sampler; max_candidates == 0 means unbounded generation.
CandidatePolicy candidate_policy() const noexcept
Returns the configured uniqueness/coverage policy.
TpeSampler & operator=(const TpeSampler &)=delete
TpeSampler(TpeSampler &&) noexcept
ObjectiveDirection direction() const noexcept
Returns the configured optimization direction.
TpeSampler(const TpeSampler &)=delete
const TpeSamplerConfig & config() const noexcept
Returns the immutable TPE tuning configuration.
ObjectiveDirection
Direction used to rank a scalar objective.
@ Maximize
Larger finite values are better.
@ Minimize
Smaller finite values are better.
CandidatePolicy
Uniqueness and coverage contract applied to sampler proposals.
@ SamplerDefault
Preserve native sampler behavior, including possible duplicates.
@ WithoutReplacement
Issue at most the requested number of unique finite candidates.
@ Exhaustive
Require a budget equal to cardinality and cover every candidate.
const char * candidate_policy_name(CandidatePolicy policy) noexcept
Returns the stable StudySpec spelling of policy.
Complete parameter assignment proposed by a sampler.
Tuning parameters for the native product-density TPE implementation.