Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added batch fitness evaluation to cmaes algorithm #139

Merged
merged 2 commits into from
Jun 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion pygmo/docstrings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2579,7 +2579,7 @@ std::string maco_set_bfe_docstring()

Set the batch function evaluation scheme.

This method will set the batch function evaluation scheme to be used for :class:`~pygmo.nsga2`.
This method will set the batch function evaluation scheme to be used for :class:`~pygmo.maco`.

Args:
b (:class:`~pygmo.bfe`): the batch function evaluation object
Expand Down Expand Up @@ -2877,6 +2877,23 @@ See also the docs of the relevant C++ method :cpp:func:`pagmo::moead_gen::get_lo
)";
}

std::string cmaes_set_bfe_docstring()
{
return R"(set_bfe(b)

Set the batch function evaluation scheme.

This method will set the batch function evaluation scheme to be used for :class:`~pygmo.cmaes`.

Args:
b (:class:`~pygmo.bfe`): the batch function evaluation object

Raises:
unspecified: any exception thrown by the underlying C++ method

)";
}

std::string cmaes_docstring()
{
return R"(__init__(gen = 1, cc = -1, cs = -1, c1 = -1, cmu = -1, sigma0 = 0.5, ftol = 1e-6, xtol = 1e-6, memory = False, force_bounds = False, seed = random)
Expand Down
1 change: 1 addition & 0 deletions pygmo/docstrings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ std::string wfg_docstring();

// user - algorithms
std::string null_algorithm_docstring();
std::string cmaes_set_bfe_docstring();
std::string cmaes_docstring();
std::string cmaes_get_log_docstring();
std::string xnes_docstring();
Expand Down
1 change: 1 addition & 0 deletions pygmo/expose_algorithms_0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ void expose_algorithms_0(py::module &m, py::class_<pagmo::algorithm> &algo, py::
py::arg("force_bounds") = false, py::arg("seed"));
expose_algo_log(cmaes_, cmaes_get_log_docstring().c_str());
cmaes_.def("get_seed", &pagmo::cmaes::get_seed, generic_uda_get_seed_docstring().c_str());
cmaes_.def("set_bfe", &pagmo::cmaes::set_bfe, cmaes_set_bfe_docstring().c_str(), py::arg("b"));

// xNES
auto xnes_ = expose_algorithm<pagmo::xnes>(m, algo, a_module, "xnes", xnes_docstring().c_str());
Expand Down
Loading