Skip to main content

The experimenter for Iterative Optimization Heuristics

Project description

IOHprofiler: IOHexperimenter

Ubuntu g++-{10, 9, 8} MacOS clang++, g++-{9, 8} Windows MVSC-2019

Experimenter for Iterative Optimization Heuristics (IOHs), built natively in* C++.

IOHexperimenter provides:

  • A framework to ease the benchmarking of any iterative optimization heuristic
  • Continuous and discrete benchmarking problems
  • Pseudo-Boolean Optimization (PBO) problem set (25 pseudo-Boolean problems)
  • Integration of the well-known Black-black Optimization Benchmarking (BBOB) problem set (24 continuous problems)
  • Interface for adding new problems and suite/problem set
  • Advanced logging module that takes care of registering the data in a seamless manner
  • Data format is compatible with IOHanalyzer

IOHexperimenter is available for:

C++ Interface

Installation

The following toolkits are needed for compiling IOHexperimenter:

  • A C++ compiler. The minimum compiler version is g++ 7 or equivalent, but we recommend g++ 9 or equivalent.
  • CMake, version 3.12 or higher

Please use the following commands to download, compile, and install this package:

> git clone --recursive https://github.com/IOHprofiler/IOHexperimenter.git
> cd IOHexperimenter
> mkdir build
> cd build
> cmake .. && make install

which installs all header files to /usr/local/include/ioh by default. If you want to change this directory, please use the following flag cmake -DCMAKE_INSTALL_PREFIX=your/path ..

If you want to change build options, check the output of cmake -L or use cmake-gui or ccmake.

Examples

To obtain a built-in problem, you could create a problem instance by passing the istance id and the search dimension to the constructor of the intended problem class, e.g.,

#include "ioh.hpp"
const auto om = std::make_shared<ioh::problem::pbo::OneMax>(1, 10); // PBO problem: instance 1, dim 10
const auto sp = std::make_shared<ioh::problem::bbob::Sphere>(1, 5); // BBOB problem: instance 1, dim 5

The instance id is intended to generalize a certain problem by some transformations, where it serves as the random seed for randomizing the transformations, e.g., affine transforms for BBOB problems and scaling of objective values for PBO problems. Please see

We also provide problem factories for this purpose:

const auto &problem_factory = ioh::problem::ProblemRegistry<ioh::problem::Integer>::instance();
const auto om = problem_factory.create("OneMax", 1, 10);

Also, we include some simple examples to demonstrate the basic usage:

For the detailed documentation of all available functionality in the IOHexperimenter, please check our this page [under construction].

Add new problems

We offer a very simple and convenient interface for integrating new benchmark problems/functions. First, you could define a new test_problem as you like. Note that the <vector> header is already imported in "ioh.hpp".

#include "ioh.hpp"

std::vector<double> test_problem(const std::vector<double> &)
{
    // the actual function body start here
    // ...
}

Then, you only need to "wrap" this new function as follows:

auto new_problem = ioh::problem::wrap_function<double>(
  &test_problem,
  "test_problem" // name for the new function
);
std::cout << const_z_problem.meta_data() << std::endl;

After wrapping, we could also create this test_problem from the problem factory. Note that, the instance id is ineffective in this approach since we haven't implemented it for the wrapped problem.

auto &factory = ioh::problem::ProblemRegistry<ioh::problem::Real>::instance();
auto new_problem_f = factory.create(
  "test_problem",  // create by name
  1,               // instance id
  10               // number of search variables
);

Alternatively, one might wish to create the new problem by subclassing the abstract problem class in IOHexperimenter, taking benefits of implementing more details, e.g., aforementioned transformations. This can be done by inheriting the corresponding problem registration class, which is

  • ioh::problem::IntegerProblem for pseudo-Boolean problems, and
  • ioh::problem::RealProblem for continuous problems.

In the below example, we show how to do this for pseudo-Boolean problems.

class NewBooleanProblem final : public ioh::problem::IntegerProblem<NewBooleanProblem>
{
protected:
    // [mandatory] The evaluate method is mandatory to implement
    std::vector<int> evaluate(const std::vector<int> &x) override
    {
        // the function body goes here
    }

    // [optional] If one wish to implement transformations on objective values
    std::vector<double> transform_objectives(std::vector<double> y) override
    {

    }

    // [optional] If one wish to implement transformations on search variables
    std::vector<double> transform_objectives(std::vector<double> y) override
    {

    }

public:
    /// [mandatory] This constructor always take `instance` as input even
    /// if it is ineffective by default. `instance` would be effective if and only if
    /// at least one of `transform_objectives` and `transform_objectives` is implemented
    NewBooleanProblem(const int instance, const int n_variables) :
        IntegerProblem(
          ioh::problem::MetaData(
            1,                     // problem id, which will be overwritten when registering this class in all pseudo-Boolean problems
            instance,              // the instance id
            "NewBooleanProblem",   // problem name
            n_variables,           // search dimensionality
            1,                     // number of objectives, only support 1 for now
            ioh::common::OptimizationType::Minimization
            )
          )
    {
    }
};

Please check this example for adding continuous problems in this manner.

Python Interface

The python interface is avaible via pip: pip install ioh. Please see here for the functionality it provides for now and some example use cases.

Contact

If you have any questions, comments or suggestions, please don't hesitate contacting us IOHprofiler@liacs.leidenuniv.nl.

Our team

When using IOHprofiler and parts thereof, please kindly cite this work as

Carola Doerr, Hao Wang, Furong Ye, Sander van Rijn, Thomas Bäck: IOHprofiler: A Benchmarking and Profiling Tool for Iterative Optimization Heuristics, arXiv e-prints:1810.05281, 2018.

@ARTICLE{IOHprofiler,
  author = {Carola Doerr and Hao Wang and Furong Ye and Sander van Rijn and Thomas B{\"a}ck},
  title = {{IOHprofiler: A Benchmarking and Profiling Tool for Iterative Optimization Heuristics}},
  journal = {arXiv e-prints:1810.05281},
  archivePrefix = "arXiv",
  eprint = {1810.05281},
  year = 2018,
  month = oct,
  keywords = {Computer Science - Neural and Evolutionary Computing},
  url = {https://arxiv.org/abs/1810.05281}
}

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

ioh-0.2.9.3.tar.gz (212.2 kB view hashes)

Uploaded Source

Built Distributions

ioh-0.2.9.3-cp39-cp39-win_amd64.whl (511.5 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

ioh-0.2.9.3-cp39-cp39-win32.whl (439.9 kB view hashes)

Uploaded CPython 3.9 Windows x86

ioh-0.2.9.3-cp39-cp39-macosx_10_15_x86_64.whl (416.8 kB view hashes)

Uploaded CPython 3.9 macOS 10.15+ x86-64

ioh-0.2.9.3-cp38-cp38-win_amd64.whl (518.6 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

ioh-0.2.9.3-cp38-cp38-win32.whl (438.5 kB view hashes)

Uploaded CPython 3.8 Windows x86

ioh-0.2.9.3-cp38-cp38-manylinux2010_x86_64.whl (593.3 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

ioh-0.2.9.3-cp38-cp38-macosx_10_15_x86_64.whl (416.8 kB view hashes)

Uploaded CPython 3.8 macOS 10.15+ x86-64

ioh-0.2.9.3-cp37-cp37m-win_amd64.whl (517.0 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

ioh-0.2.9.3-cp37-cp37m-win32.whl (435.8 kB view hashes)

Uploaded CPython 3.7m Windows x86

ioh-0.2.9.3-cp37-cp37m-manylinux2010_x86_64.whl (598.6 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

ioh-0.2.9.3-cp37-cp37m-macosx_10_15_x86_64.whl (408.5 kB view hashes)

Uploaded CPython 3.7m macOS 10.15+ x86-64

ioh-0.2.9.3-cp36-cp36m-win_amd64.whl (517.0 kB view hashes)

Uploaded CPython 3.6m Windows x86-64

ioh-0.2.9.3-cp36-cp36m-win32.whl (435.7 kB view hashes)

Uploaded CPython 3.6m Windows x86

ioh-0.2.9.3-cp36-cp36m-manylinux2010_x86_64.whl (598.4 kB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64

ioh-0.2.9.3-cp36-cp36m-macosx_10_15_x86_64.whl (408.4 kB view hashes)

Uploaded CPython 3.6m macOS 10.15+ x86-64

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