Skip to main content

A collection of analytical benchmark functions in multiple fidelities

Project description

MF2: Multi-Fidelity-Functions

Package Info Status Support
PyPI version Build Status Documentation Status
Conda Coverage Status Gitter
PyPI - Python Version Codacy Badge
License: GPL v3 Project Status: Active – The project has reached a stable, usable state and is being actively developed.
DOI CII Best Practices
status

Introduction

The mf2 package provides consistent, efficient and tested Python implementations of a variety of multi-fidelity benchmark functions. The goal is to simplify life for numerical optimization researchers by saving time otherwise spent reimplementing and debugging the same common functions, and enabling direct comparisons with other work using the same definitions, improving reproducibility in general.

A multi-fidelity function usually reprensents an objective which should be optimized. The term 'multi-fidelity' refers to the fact that multiple versions of the objective function exist, which differ in the accuracy to describe the real objective. A typical real-world example would be the aerodynamic efficiency of an airfoil, e.g., its drag value for a given lift value. The different fidelity levels are given by the accuracy of the evaluation method used to estimate the efficiency. Lower-fidelity versions of the objective function refer to less accurate, but simpler approximations of the objective, such as computational fluid dynamic simulations on rather coarse meshes, whereas higher fidelity levels refer to more accurate but also much more demanding evaluations such as prototype tests in wind tunnels. The hope of multi-fildelity optimization approaches is that many of the not-so-accurate but simple low-fidelity evaluations can be used to achieve improved results on the realistic high-fidelity version of the objective where only very few evaluations can be performed.

The only dependency of the mf2 package is the numpy package.

Documentation is available at mf2.readthedocs.io

Installation

The recommended way to install mf2 is with Python's pip:

python3 -m pip install --user mf2

or alternatively using conda:

conda install -c conda-forge mf2

For the latest version, you can install directly from source:

python3 -m pip install --user https://github.com/sjvrijn/mf2/archive/master.zip

To work in your own version locally, it is best to clone the repository first, and additionally install the dev-requirements:

git clone https://github.com/sjvrijn/mf2.git
cd mf2
python3 -m pip install --user -e .[dev]

Example Usage

import mf2
import numpy as np

# set numpy random seed for reproducibility
np.random.seed(42)
# generate 5 random samples in 2D as matrix
X = np.random.random((5, 2))

# print high fidelity function values
print(mf2.branin.high(X))
# Out: array([36.78994906 34.3332972  50.48149005 43.0569396  35.5268224 ])

# print low fidelity function values
print(mf2.branin.low(X))
# Out: array([-5.8762639  -6.66852889  3.84944507 -1.56314141 -6.23242223])

For more usage examples, please refer to the full documentation on readthedocs.

Contributing

Contributions to this project such as bug reports or benchmark function suggestions are more than welcome! Please refer to CONTRIBUTING.md for more details.

Contact

The Gitter channel is the preferred way to get in touch for any other questions, comments or discussions about this package.

Citation

Was this package useful to you? Great! If this leads to a publication, we'd appreciate it if you would cite our JOSS paper:

@article{vanRijn2020,
  doi = {10.21105/joss.02049},
  url = {https://doi.org/10.21105/joss.02049},
  year = {2020},
  publisher = {The Open Journal},
  volume = {5},
  number = {52},
  pages = {2049},
  author = {Sander van Rijn and Sebastian Schmitt},
  title = {MF2: A Collection of Multi-Fidelity Benchmark Functions in Python},
  journal = {Journal of Open Source Software}
}

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

mf2-2021.10.0.tar.gz (35.9 kB view details)

Uploaded Source

Built Distribution

mf2-2021.10.0-py3-none-any.whl (37.8 kB view details)

Uploaded Python 3

File details

Details for the file mf2-2021.10.0.tar.gz.

File metadata

  • Download URL: mf2-2021.10.0.tar.gz
  • Upload date:
  • Size: 35.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5

File hashes

Hashes for mf2-2021.10.0.tar.gz
Algorithm Hash digest
SHA256 d42866dd232b14ed0b78c02e8a756363ef4348907f525ea6d875628ade6b2fdc
MD5 03d07a6950e4451ddf039b1195133590
BLAKE2b-256 db5072ebd93b15a13e4fcc16f875049eb6bcaab7711c805055a950d74490a75a

See more details on using hashes here.

File details

Details for the file mf2-2021.10.0-py3-none-any.whl.

File metadata

  • Download URL: mf2-2021.10.0-py3-none-any.whl
  • Upload date:
  • Size: 37.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5

File hashes

Hashes for mf2-2021.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1eef3e014ce721f13c5aa28d498f7b0c33518b683bc94355163101d07f66d2c4
MD5 3d062efbd1ad9a8cf318f2413e3da77d
BLAKE2b-256 21af7ef6368b0683944873c61466cb42e4db1d66c04bbb4ded510166eb4a5229

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page