Package: argmin-testfunctions-py
argmin-testfunctions-pyWebsite|Book|Docs (latest release)|Docs (main branch)This Python module makes the test functions of theargmin_testfunctionsRust crate available in Python.
For each test function the derivative and Hessian are available as well.
While most functions are two-dimensional, some allow an arbitrary number of parameters.
For some functions additional optional parameters are accessible, which can be used to modify the shape of the test function.
For details on the individual test functions please consult the docs of the Rust library, either for thelatest releaseor thecurrent main branch.Examplesfromargmin_testfunctions_pyimport*# Ackley (arbitrary number of parameters)c=ackley([0.1,0.2,0.3,0.4])g=ackley_derivative([0.1,0.2,0.3,0.4])h=ackley_hessian([0.1,0.2,0.3,0.4])# Ackley with custom (optional) parameters a, b, and c.c=ackley([0.1,0.2,0.3,0.4],a=10.0,b=0.3,c=3.14)g=ackley_derivative([0.1,0.2,0.3,0.4],a=10.0,b=0.3,c=3.14)h=ackley_hessian([0.1,0.2,0.3,0.4],a=10.0,b=0.3,c=3.14)# Bealec=beale([0.1,0.2])g=beale_derivative([0.1,0.2])h=beale_hessian([0.1,0.2])# Boothc=booth([0.1,0.2])g=booth_derivative([0.1,0.2])h=booth_hessian([0.1,0.2])# Bukin No. 6c=bukin_n6([0.1,0.2])g=bukin_n6_derivative([0.1,0.2])h=bukin_n6_hessian([0.1,0.2])# Cross-in-trayc=cross_in_tray([0.1,0.2])g=cross_in_tray_derivative([0.1,0.2])h=cross_in_tray_hessian([0.1,0.2])# Easomc=easom([0.1,0.2])g=easom_derivative([0.1,0.2])h=easom_hessian([0.1,0.2])# Eggholderc=eggholder([0.1,0.2])g=eggholder_derivative([0.1,0.2])h=eggholder_hessian([0.1,0.2])# Goldstein-Pricec=goldsteinprice([0.1,0.2])g=goldsteinprice_derivative([0.1,0.2])h=goldsteinprice_hessian([0.1,0.2])# Himmelblauc=himmelblau([0.1,0.2])g=himmelblau_derivative([0.1,0.2])h=himmelblau_hessian([0.1,0.2])# Holder-Tablec=holder_table([0.1,0.2])g=holder_table_derivative([0.1,0.2])h=holder_table_hessian([0.1,0.2])# Levy (arbitrary number of parameters)c=levy([0.1,0.2,0.3,0.4])g=levy_derivative([0.1,0.2,0.3,0.4])h=levy_hessian([0.1,0.2,0.3,0.4])# Levy No. 13c=levy_n13([0.1,0.2])g=levy_n13_derivative([0.1,0.2])h=levy_n13_hessian([0.1,0.2])# Matyasc=matyas([0.1,0.2])g=matyas_derivative([0.1,0.2])h=matyas_hessian([0.1,0.2])# McCorminckc=mccorminck([0.1,0.2])g=mccorminck_derivative([0.1,0.2])h=mccorminck_hessian([0.1,0.2])# Pichenyc=picheny([0.1,0.2])g=picheny_derivative([0.1,0.2])h=picheny_hessian([0.1,0.2])# Rastrigin (with arbitrary number of parameters)c=rastrigin([0.1,0.2,0.3,0.4])g=rastrigin_derivative([0.1,0.2,0.3,0.4])h=rastrigin_hessian([0.1,0.2,0.3,0.4])# Rastrigin with custom (optional) parameter a.c=rastrigin([0.1,0.2,0.3,0.4],a=5.0)g=rastrigin_derivative([0.1,0.2,0.3,0.4],a=5.0)h=rastrigin_hessian([0.1,0.2,0.3,0.4],a=5.0)# Rosenbrock (with arbitrary number of parameters)c=rosenbrock([0.1,0.2,0.3,0.4])g=rosenbrock_derivative([0.1,0.2,0.3,0.4])h=rosenbrock_hessian([0.1,0.2,0.3,0.4])# Rosenbrock with custom (optional) parameters a and b.c=rosenbrock([0.1,0.2,0.3,0.4],a=5.0,b=200.0)g=rosenbrock_derivative([0.1,0.2,0.3,0.4],a=5.0,b=200.0)h=rosenbrock_hessian([0.1,0.2,0.3,0.4],a=5.0,b=200.0)# Schaffer No. 2c=schaffer_n2([0.1,0.2])g=schaffer_n2_derivative([0.1,0.2])h=schaffer_n2_hessian([0.1,0.2])# Schaffer No. 4c=schaffer_n4([0.1,0.2])g=schaffer_n4_derivative([0.1,0.2])h=schaffer_n4_hessian([0.1,0.2])# Sphere (with arbitrary number of parameters)c=sphere([0.1,0.2,0.3,0.4])g=sphere_derivative([0.1,0.2,0.3,0.4])h=sphere_hessian([0.1,0.2,0.3,0.4])# Styblinski-Tangc=styblinski_tang([0.1,0.2])g=styblinski_tang_derivative([0.1,0.2])h=styblinski_tang_hessian([0.1,0.2])# Three-hump-camelc=threehumpcamel([0.1,0.2])g=threehumpcamel_derivative([0.1,0.2])h=threehumpcamel_hessian([0.1,0.2])LicenseLicensed under either ofApache License, Version 2.0, (LICENSE-APACHEorhttp://www.apache.org/licenses/LICENSE-2.0)MIT License (LICENSE-MITorhttp://opensource.org/licenses/MIT)at your option.ContributionUnless 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.