[−][src]Crate proximal_optimize
A hill-climbing optimizer that works by systematically testing nearby candidates.
This optimizer works even when the objective function (for which a maximum
or minimum value is sought) is not differentiable, so that a gradient
magnitude cannot be calculated. Any function may be optimized,
provided its parameters are (or can be converted from) a &[f64]
and its
output implments PartialOrd
.
Here's an example optimization, using the Rosenbrock function.
use proximal_optimize::ProximalOptimizer; let mut po = ProximalOptimizer::new(2); po.iterations(10000); let initial_position = vec![-1.2, 1.0]; let optimized = po.optimize(&initial_position, |x: &[f64]| { ((1.0 - x[0]) * (1.0 - x[0]) + 100.0 * (x[1] - x[0] * x[0]) * (x[1] - x[0] * x[0])) }).unwrap(); println!("Optimized values is: {:?}", &optimized); assert_eq!(optimized, vec![0.999208314861111, 0.998416214890118]);
Structs
ProximalOptimizer | A hill-climbing optimizer that works by systematically testing nearby candidates. |
Enums
ProximalOptimizerErr |
Constants
DEFAULT_COMPRESSION_RATIO | |
DEFAULT_EXPANSION_RATIO | |
DEFAULT_INITIAL_STEP_SIZE | |
DEFAULT_NUM_ITERATIONS |