A collection of analytical benchmark functions in multiple fidelities
Project description
Multi-Fidelity-Functions
This package contains Python implementations for a variety of multi-fidelity
benchmark functions. The only dependency is the numpy
package.
Installation
The recommended way to install mf2
is with Python's Pip:
python3 -m pip install --user 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:
git clone https://github.com/sjvrijn/mf2.git
cd mf2
python3 -m pip install --user -e .
Example Usage
import mf2
import numpy as np
forrester = mf2.Forrester(ndim=2)
np.random.seed(42)
X = np.random.random((5, 2)) # 5 samples in 2D
print(forrester.high(X))
# Out: array([ 6.20598519, -2.90702413, -0.96082789, 0.78490341, -2.56183228])
print(forrester.low(X))
# Out: array([6.47672047, 1.89322581, 7.95952025, 5.77115291, 2.17314591])
For more usage examples, please refer to the full documentation on readthedocs.
Contributing
Contributions to this project are more than welcome!
Bugs
If you've found a problem of some sort, please open an issue on GitHub.
Additions
To add new functions to this package, you can roughly follow the following steps:
- Implement the function in a new file in the appropriate (sub)folder
- Add it to the tests:
- add the function in the
tests/property_test.py
andtests/regression_test.py
files - run the
tests/create_regression_data.py
file to generate the new data files - run the tests
- add the function in the
- Make sure to commit all new and updated files to git (Travis-CI will complain otherwise ;)
- Create a pull-request!
If you need any help with this process, please get in touch as outlined under Contact.
Contact
The Gitter channel is the preferred way to get in touch for any other questions, comments or discussions about this package.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.