cb5ecf33f0d99ff781b5894e47f6a28f1843b1ef
optimizer
A Rust library for black-box optimization using Tree-Parzen Estimator (TPE).
Features
- Optuna-like API for hyperparameter optimization
- Float, integer, and categorical parameter types
- Log-scale and stepped parameter sampling
- Sync and async optimization with parallel trial evaluation
Quick Start
use optimizer::{Direction, Study, TpeSampler};
let sampler = TpeSampler::builder().seed(42).build();
let study: Study<f64> = Study::with_sampler(Direction::Minimize, sampler);
study
.optimize_with_sampler(20, |trial| {
let x = trial.suggest_float("x", -10.0, 10.0)?;
Ok::<_, optimizer::TpeError>(x * x)
})
.unwrap();
let best = study.best_trial().unwrap();
println!("Best value: {} at x={:?}", best.value, best.params);
Feature Flags
async- Enable async optimization methods (requires tokio)
Documentation
Full API documentation is available at docs.rs/optimizer.
License
MIT
Description
Languages
Rust
99.8%
Shell
0.2%