21 Commits

Author SHA1 Message Date
Manuel Raimann f4b0631178 feat: add enqueue_trial() for pre-specified parameter evaluation
Add Study::enqueue() to push specific parameter configurations onto a
FIFO queue. The next call to ask()/create_trial() or the next iteration
in optimize() pops the front entry and injects it into the trial so
that suggest_param() returns the pre-filled value instead of sampling.

Parameters missing from an enqueued map fall back to normal sampling,
and once the queue is drained regular sampler-driven trials resume.
2026-02-11 17:23:25 +01:00
Manuel Raimann 52f3c074dc feat: add trial user attributes for logging and analysis
Add AttrValue enum (Float, Int, String, Bool) with From impls and
set_user_attr/user_attr/user_attrs methods on both Trial and
CompletedTrial. Attributes set during optimization are propagated
through complete_trial and prune_trial. AttrValue is re-exported
at crate root and in the prelude.
2026-02-11 17:18:17 +01:00
Manuel Raimann f67188e3a7 feat: add ask() and tell() methods for ask-and-tell interface 2026-02-11 17:11:38 +01:00
Manuel Raimann 72da883add feat: add Study::top_trials(n) for retrieving best N trials
Returns the top N completed trials sorted by objective value,
respecting the study's optimization direction. Pruned and failed
trials are excluded.
2026-02-11 17:08:10 +01:00
Manuel Raimann bc278d83a3 feat: add timeout-based optimization methods (optimize_until)
Add duration-based variants of all optimization methods that run trials
until a wall-clock deadline rather than for a fixed trial count:

- optimize_until(duration, objective)
- optimize_until_with_callback(duration, objective, callback)
- optimize_until_async(duration, objective)
- optimize_until_parallel(duration, concurrency, objective)
2026-02-11 17:06:08 +01:00
Manuel Raimann 432c74b927 feat: add MedianPruner for statistics-based trial pruning
Prunes trials whose intermediate values are worse than the median
of completed trials at the same step. Supports configurable warmup
steps and minimum trial count before pruning activates.
2026-02-11 16:32:03 +01:00
Manuel Raimann 8199ba6b43 feat: add ThresholdPruner for fixed-bound trial pruning 2026-02-11 16:28:22 +01:00
Manuel Raimann 5dc81fa0ab Implement Parameters API
- Add `.name()` builder method on all 5 parameter types for custom labels
- Add `CompletedTrial::get(&param)` for typed parameter access
- Add `Display` impl on `ParamValue`
- Add prelude module at `optimizer::prelude::*`
- Shadow `_with_sampler` methods on `Study<f64>` so `optimize()` auto-uses
  the configured sampler; deprecate `_with_sampler` variants
- Use runtime `Any` downcasting with `trial_factory` to avoid E0592
- Update all examples and tests to use the new API

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 18:54:55 +01:00
Manuel Raimann 55e50e6afb Implement Parameters API 2026-02-06 17:15:47 +01:00
Manuel Raimann 02ec9498c4 refactor: reorganize sampler module and update imports 2026-02-04 13:14:22 +01:00
Manuel Raimann 4ce4311c68 Implement Multivariant TPE 2026-02-02 17:25:50 +01:00
Manuel Raimann b9a90ebec3 Format 2026-01-31 11:56:37 +01:00
Manuel Raimann 747e1928b9 feat: add tests for suggest_bool and suggest_range methods 2026-01-31 11:34:36 +01:00
Manuel Raimann b482d56e89 Implement grid search 2026-01-30 22:01:44 +01:00
Manuel Raimann d8ef4352c3 refactor: replace TpeError with Error in the optimizer library 2026-01-30 19:24:58 +01:00
Manuel Raimann 3898136341 Refactor 2026-01-30 19:21:54 +01:00
Manuel Raimann daab3ea202 Remove Serde 2026-01-30 18:43:45 +01:00
Manuel Raimann 530faba61c refactor: rename library from optimize to optimizer 2026-01-30 18:08:13 +01:00
Manuel Raimann 482354b251 fix: update condition to use is_multiple_of for better readability 2026-01-30 17:46:13 +01:00
Manuel Raimann bb5ef05c10 feat: add async integration tests for optimization library 2026-01-30 17:45:11 +01:00
Manuel Raimann 4db6e56466 Initial Implementation 2026-01-30 17:24:56 +01:00