IDerivativeFreeFunctionOptimizer<T>

Interfaces · AiDotNet.Interfaces

Interface for optimizing a scalar-valued function over a vector of parameters when no gradient is available.

Known implementations: AntColonyOptimizer<T, TInput, TOutput>, CMAESOptimizer<T, TInput, TOutput>, DifferentialEvolutionOptimizer<T, TInput, TOutput>, GeneticAlgorithmOptimizer<T, TInput, TOutput>, NelderMeadOptimizer<T, TInput, TOutput>, ParticleSwarmOptimizer<T, TInput, TOutput>, TabuSearchOptimizer<T, TInput, TOutput>

For Beginners

Some functions do not have a usable slope. Maybe the function has sharp corners, maybe it is the output of a simulation you cannot differentiate, or maybe it is just a formula somebody handed you as a black box. Gradient-free optimizers work by sampling the function at many points and moving toward whichever points came back best, rather than by following a slope downhill. They typically need many more function evaluations than a gradient method, but they work where gradient methods cannot run at all.

How It Works

This is the gradient-free counterpart of IFunctionOptimizer. Where IFunctionOptimizer requires the caller to supply both the objective value and its gradient, this interface requires only the objective value, so it can be used with objectives that are non-differentiable, discontinuous, noisy, or only available as a black-box evaluation (a simulation, a backtest, an external process).

Implemented by search-based optimizers such as Nelder-Mead, simulated annealing, particle swarm, genetic algorithms, and CMA-ES.

Methods

Method Summary
Vector<T> Minimize(Vector<T> initialParameters, Func<Vector<T>, T> objective, int maxIterations, T tolerance) Minimizes a function starting from the given initial parameters, using only objective values (no gradients).