Crate argmin_testfunctions
source ·Expand description
A collection of two- and multidimensional test functions (and their derivatives and Hessians)
for optimization algorithms. For two-dimensional test functions, the derivate and Hessian
calculation does not allocate. For multi-dimensional tes functions, the derivative and Hessian
calculation comes in two variants. One variant returns Vec
s and hence does allocate. This is
needed for cases, where the number of parameters is only known at run time. In case the number
of parameters are known at compile-time, the _const
variants can be used, which return fixed
size arrays and hence do not allocate.
The derivative and Hessian calculation is always named <test function name>_derivative
and
<test function name>_hessian
, respectively. The const generics variants are defined as
<test function name>_derivative_const
and <test function name>_hessian_const
.
Some functions, such as ackley
, rosenbrock
and rastrigin
come with additional optional
parameters which change the shape of the functions. These additional parameters are exposed in
ackley_abc
, rosenbrock_ab
and rastrigin_a
.
All functions are generic over their inputs and work with [f64]
and [f32]
.
§Python wrapper
Thanks to the python module
argmin-testfunctions-py
, it is possible
to use the functions in Python as well. Note that the derivative and Hessian calculation used
in the wrapper will always allocate.
§Running the tests and benchmarks
The tests can be run with
cargo test
The test functions derivatives and Hessians are tested against finitediff using proptest to sample the functions at various points.
All functions are benchmarked using criterion.rs. Run the benchmarks with
cargo bench
The report is available in target/criterion/report/index.html
.
§Contributing
This library is the most useful the more test functions it contains, therefore any contributions are highly welcome. For inspiration on what to implement and how to proceed, feel free to have a look at this issue.
While most of the implemented functions are probably already quite efficient, there are probably a few which may profit from performance improvements.
§License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
§Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Functions§
- Ackley test function
- Ackley test function
- Derivative of Ackley test function
- Derivative of Ackley test function
- Hessian of Ackley test function
- Hessian of Ackley test function
- Derivative of Ackley test function
- Derivative of Ackley test function
- Hessian of Ackley test function
- Hessian of Ackley test function
- Beale test function
- Derivative of Beale test function
- Derivative of Beale test function
- Booth test function
- Derivative of Booth test function
- Hessian of Booth test function
- Bukin test function No. 6
- Derivative of Bukin test function No. 6
- Hessian of Bukin test function No. 6
- Cross-in-tray test function
- Derivative of Cross-in-tray test function
- Hessian of Cross-in-tray test function
- Easom test function
- Derivative of Easom test function
- Hessian of Easom test function
- Eggholder test function
- Derivative of Eggholder test function
- Hessian of Eggholder test function
- Goldstein-Price test function
- Derivative of Goldstein-Price test function
- Hessian of Goldstein-Price test function
- Himmelblau test function
- Derivative of Himmelblau test function
- Hessian of Himmelblau test function
- Holder table test function
- Derivative of the Holder table test function
- Hessian of the Holder table test function
- Levy test function
- Derivative of Levy test function
- Derivative of Levy test function
- Hessian of Levy test function
- Hessian of Levy test function
- Levy test function No. 13
- Derivative of Levy test function No. 13
- Hessian of Levy test function No. 13
- Matyas test function
- Derivative of Matyas test function
- Hessian of Matyas test function
- McCorminck test function
- Derivative of McCorminck test function
- Hessian of McCorminck test function
- Picheny test function
- Derivative of Picheny test function
- Hessian of Picheny test function
- Rastrigin test function
- Rastrigin test function
- Derivative of Rastrigin test function where
a
can be chosen freely - Derivative of Rastrigin test function where
a
can be chosen freely - Hessian of Rastrigin test function where
a
can be chosen freely - Hessian of Rastrigin test function where
a
can be chosen freely - Derivative of Rastrigin test function
- Derivative of Rastrigin test function
- Hessian of Rastrigin test function
- Hessian of Rastrigin test function
- Multidimensional Rosenbrock test function
- Multidimensional Rosenbrock test function
- Derivative of the multidimensional Rosenbrock test function
- Derivative of the multidimensional Rosenbrock test function
- Hessian of the multidimensional Rosenbrock test function
- Hessian of the multidimensional Rosenbrock test function
- Derivative of the multidimensional Rosenbrock test function
- Derivative of the multidimensional Rosenbrock test function
- Hessian of the multidimensional Rosenbrock test function
- Hessian of the multidimensional Rosenbrock test function
- Schaffer test function No. 2
- Schaffer test function No. 4
- Derivative of Schaffer test function No. 2
- Hessian of Schaffer test function No. 2
- Derivative of Schaffer test function No. 4
- Hessian of Schaffer test function No. 4
- Sphere test function
- Derivative of sphere test function
- Derivative of sphere test function
- Hessian of sphere test function
- Hessian of sphere test function
- Styblinski-Tang test function
- Derivative of Styblinski-Tang test function
- Derivative of Styblinski-Tang test function
- Hessian of Styblinski-Tang test function
- Hessian of Styblinski-Tang test function
- Three-hump camel test function
- Derivative of Three-hump camel test function
- Hessian of Three-hump camel test function
- Zero test function
- Derivative of zero test function
- Derivative of zero test function (const version)
- Hessian of zero test function
- Hessian of zero test function (const version)