Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.7%) to scientific vocabulary
Keywords
Repository
OMADS - A blackbox optimization python package
Basic Info
Statistics
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 1
- Releases: 7
Topics
Metadata Files
README.md
OMADS
MADS: A python implementation for the mesh adaptive direct search (MADS) method; ORTHO-MADS algorithm. OMADS can solve both single- and multi-objective optimization problems.
For technical and code documentation, please visit OMADS Webpage.
Version 2.1.0
License & copyright
© Ahmed H. Bayoumy
Citation
If you use this code, please cite it as below.
pycon
@software{OMADS_AB,
author = {Bayoumy, A.},
title = {OMADS},
year = 2022,
publisher = {Github},
version = {2407},
url = {https://github.com/Ahmed-Bayoumy/OMADS}
}
How to use OMADS package
After installing the OMADS package from PYPI website, the functions and classes of OMADS basic
module can be imported directly to the python script as follows:
pycon
from OMADS import *
How to run OMADS from terminal
After installing OMADS the SEARCH, POLL, and MADS modules can be called directly from a
terminal window under the src directory. The path of the JSON template, which contains the problem input parameters,
should be entered as an input argument to the aforementioned modules call.
commandline
python ./OMADS/POLL.py ../../tests/unconstrained/rosenbrock.json
python ./OMADS/SEARCH.py ../../tests/unconstrained/rosenbrock.json
python ./OMADS/MADS.py ../../tests/unconstrained/rosenbrock.json
Input parameters
Input parameters are serialized in a JSON template using predefined attributes (keywords) under four dictionaries;
evaluator, param, options and search. Here is a brief description of each dictionary and its key attributes.
evaluator: in this dictionary, we define the blackbox location and the name of input and output files (if exist)blackbox: blackbox executable file name, or the function name if this is an internal function defined within the BM_suiteinternal: the name of the testing category that holds your internal/external test function or blackbox evaluatorcon: internal constrained single-objective functionuncon: internal unconctrained single-objective functionexe: external executable blackbox evaluatorinput: the name of the input file (considered if external executable was defined)
*
output: the name of the output file (considered if external executable was defined)param: problem setupbaseline: this is the initial starting point (initial design vector)lb: lower bounds vectorub: upper bounds vectorvar_names: list of design variables namevar_types: list of the variables typeR: real variableI: integer variableC_<set name>: categorical variable. A set name from the sets dict should be added after the underscore that followsCD_<set name>: discrete variable. A set name from the sets dict should be added after the underscore that followsD
Sets: a dictionary where its keys refer to the set name and their value should be assigned to a list of values (the values can be of heterogeneous type)scaling: scaling factorpost_dir: the location of the post directory where the results file shall be saved if requestedconstraints_type: list of the constraints barrier type, i.e., progressive barrier (PB) and extreme barrier (EB)LAMBDA: list of the initial Lagrangian multipliers assigned to the constraintsRHO: list of the initial penalty parameterhmax: the maximum feasibility thresholdnobj: number of objectivesisPareto: boolean for running a Pareto studymeshType: specify whether to use granular or orthogonal meshGMESH: granular meshOMESH: orthogonal mesh
*
name: problem name (that name will be used for naming the output files)options: algorithmic optionsseed: the random generator seed that ensures results reproducibility. This should be an integer valuebudget: the evaluation budget; the maximum number of evaluations for the blackbox definedtol: the minimum poll size tolerance; the algorithm terminates once the poll size falls below this valuepsize_init: initial poll sizedisplay: a boolean for displaying verbose outputs per iteration in the terminal windowopportunistic: a boolean for enabling opportunistic searchcheck_cache: a boolean for checking if the current point is a duplicate by checking its hashed address (integer signature)store_cache: a boolean for saving evaluated designs in the cache memorycollect_y: currently inactive (to be used when the code is integrated with the PyADMM MDO module)rich_direction: a boolean that enables capturing a rich set of directions in a generalized patternprecision: a string character input that controls thedtypedecimal resolution used by the numerical librarynumpyhigh:float1281e-18medium:float641e-15low:float321e-8save_results: a boolean for generating aMADS.csvfile for the output results under the post directorysave_coordinates: saving poll coordinates (spinners) of each iteration in a JASON dictionary template that can be used for visualizationsave_all_best: a boolean for saving only incumbent solutions
*
parallel_mode: a boolean for parallel computation of the poll setsearch: the search step optionstype: search type can take one of the following valuesVNS: variable neighbor searchsampling: sampling searchBO: Bayesian optimization (TODO: not published yet as it is still in the testing and BM phase)NM: Nelder-Mead (TODO: not published yet as it is still in the testing and BM phase)PSO: particle swarm optimization (TODO: not published yet as it is in the testing phase)CMA-ES: covariance matrix adaptation evolution strategy (TODO: not published yet as it is in the testing phase)
s_method: can take one of the following valuesACTIVE: Online active sampling using kernel density estimators (KDE)LH: Latin Hypercube sampling\RS: random samplingHALTON: Halton sampling
*
ns: number of samples
Multiobjective MADS
The poll, search, and MADS algorithms are capable of solving both unconstrained and constrained multiobjective problems by conducting a Pareto study. The approximated Pareto front (non-dominated solutions) are saved in a separate CSV file named with the suffix Pareto "{problemname}Pareto.out". The figures below display the results of test functions chosen from the literature.
Constrained test functions
Unconstrained test functions
Benchmarking
To benchmark OMADS, per se, you need to install the non-linear optimization benchmarking project NOBM (will be installed automatically when you install OMADS) from
PYPI. Two benchmarking suits are provided under the BMDFO package -- BMDFO stands for
benchmarking derivative-free optimization algorithms. The benchmarking suits have different constrained and
unconstrained optimization problems with various characteristics. The BMDFO modules can be imported directly
to the python script as shown below:
pycon
from BMDFO import toy
For more details about the NOBM project and its use, check this link.
After running the benchmarking suite using various seed values, which are used to initialize the random number generator,
a BM_report.csv file will be created in the post directory under the examples folder.
Example
```pycon import OMADS import numpy as np
def rosen(x, argv): x = np.asarray(x) y = [np.sum(100.0 * (x[1:] - x[:-1] * 2.0) ** 2.0 + (1 - x[:-1]) ** 2.0, axis=0), [0]] return y
eval = {"blackbox": rosen} param = {"baseline": [-2.0, -2.0], "lb": [-5, -5], "ub": [10, 10], "varnames": ["x1", "x2"], "scaling": 10.0, "postdir": "./post"} options = {"seed": 0, "budget": 100000, "tol": 1e-12, "display": True}
data = {"evaluator": eval, "param": param, "options":options}
out = {}
out is a dictionary that will hold output data of the final solution. The out dictionary has three keys: "xmin", "fmin" and "hmin"
out = OMADS.main(data)
```
Results
text
--- Run Summary ---
Run completed in 0.0303 seconds
Random numbers generator's seed 0
xmin = [1.0, 1.0]
hmin = 1e-30
fmin = 0.0
#bb_eval = 185
#iteration = 46
nb_success = 4
psize = 9.094947017729282e-13
psize_success = 1.0
psize_max = 2.0
https://github.com/Ahmed-Bayoumy/OMADS/assets/22842095/5dc72c34-4722-4d93-8c84-d17f5595556d
Owner
- Name: Ahmed Bayoumy
- Login: Ahmed-Bayoumy
- Kind: user
- Location: Montreal, QC, Canada
- Company: McGill University
- Repositories: 4
- Profile: https://github.com/Ahmed-Bayoumy
GitHub Events
Total
- Watch event: 2
- Push event: 8
Last Year
- Watch event: 2
- Push event: 8
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 1
- Total pull requests: 24
- Average time to close issues: 2 days
- Average time to close pull requests: 1 day
- Total issue authors: 1
- Total pull request authors: 1
- Average comments per issue: 1.0
- Average comments per pull request: 0.0
- Merged pull requests: 23
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 1
- Pull requests: 6
- Average time to close issues: 2 days
- Average time to close pull requests: about 14 hours
- Issue authors: 1
- Pull request authors: 1
- Average comments per issue: 1.0
- Average comments per pull request: 0.0
- Merged pull requests: 5
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- chengwei-xia (1)
Pull Request Authors
- Ahmed-Bayoumy (32)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 113 last-month
- Total dependent packages: 0
- Total dependent repositories: 1
- Total versions: 13
- Total maintainers: 1
pypi.org: omads
Mesh Adaptive Direct Search (MADS)
- Homepage: https://github.com/Ahmed-Bayoumy/OMADS
- Documentation: https://omads.readthedocs.io/
- License: GNU Lesser General Public License v3 (LGPLv3)
-
Latest release: 2.1.0
published over 2 years ago