A library for optimization benchmark functions in python
Project description
PyBenchFCN
A python implementation of optimization benchmark functions (v0.0.2)
Introduction
This library is a python implementation for the MatLab package BenchmarkFcns Toolbox.
You can simply install with command pip install PyBenchFCN
.
- Pre-request:
numpy
How to use
To use the package, one may see the sample code in Factory.py
in the repository, or follow the script below.
import numpy as np
# import single objective problems from PyBenchFCN
from PyBenchFCN import SingleObjectiveProblem as SOP
n_var = 10 # dimension of problem
n_pop = 3 # size of population
problem = SOP.ackleyfcn(n_var) # Ackley problem
print( np.round(problem.optimalF, 5) ) # show rounded optimal value
xl, xu = problem.boundaries # bound of problem
x = np.random.uniform(xl, xu, n_var) # initialize a solution
print( problem.f(x) ) # show fitness value
X = np.random.uniform( xl, xu, (n_pop, n_var) ) # initialize a population
print( problem.F(X) ) # show fitness values
List of Functions
Totally, 61 functions are implemented. Please check the homepage of BenchmarkFcns Toolbox for the documentation.
- Ackley Function
- Ackley N.2 Function
- Ackley N.3 Function
- Adjiman Function
- Alpine N.1 Function
- Alpine N.2 Function
- Bartelsconn Function
- Beale Function
- Bird Function
- Bohachevsky N.1 Function
- Bohachevsky N.2 Function
- Booth Function
- Brent Function
- Brown Function
- Bukin N.6 Function
- Cross-in-Tray Function
- Deckkers-Aarts Function
- Dropwave Function
- Easom Function
- Egg Crate Function
- Eggholder Function
- Exponential Function
- Goldstein-Price Function
- Gramacy & Lee Function
- Griewank Function
- Happy Cat Function
- Himmelblau Function
- Holder-Table Function
- Keane Function
- Leon Function
- Levi N.13 Function
- Matyas Function
- McCormick Function
- Periodic Function
- Picheny Function
- Powell Sum Function
- Qing Function
- Quartic Function
- Rastrigin Function
- Ridge Function
- Rosenbrock Function
- Salomon Function
- Schaffer N.1 Function
- Schaffer N.2 Function
- Schaffer N.3 Function
- Schaffer N.4 Function
- Schwefel 2.20 Function
- Schwefel 2.21 Function
- Schwefel 2.22 Function
- Schwefel 2.23 Function
- Schwefel Function
- Sphere Function
- Styblinskitank Function
- Sum Squares Function
- Three-Hump Camel Function
- Wolfe Function
- Xin-She Yang N.1 Function
- Xin-She Yang N.2 Function
- Xin-She Yang N.3 Function
- Xin-She Yang N.4 Function
- Zakharov Function
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
PyBenchFCN-0.0.3.tar.gz
(12.3 kB
view hashes)
Built Distribution
PyBenchFCN-0.0.3-py3-none-any.whl
(12.3 kB
view hashes)
Close
Hashes for PyBenchFCN-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f02785223b5871297b2c1f0e073518635a2f1533c3083a096b3998b6244d7d7a |
|
MD5 | c4fa2ff8fbe6dc8b4c1535fad89001e5 |
|
BLAKE2b-256 | c1b58e2ec6bfd72ea2c30e23ccf26cc2a76be6b76ca228fb0c1c4a21c0169882 |