Skip to content
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
48 changes: 26 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,31 @@ This README provides a high level overview of the implemented modules, and provi

## Table of Contents

1. [Installation](#installation)
2. [Usage](#usage)
- [Python only interface](#python-only)
- [Ask-Tell Interface](#ask-tell)
- [C++ Backend](#c-backend)
3. [Modules](#modules)
- [Matrix Adaptation](#matrix-adaptation)
- [Active Update](#active-update)
- [Elitism](#elitism)
- [Orthogonal Sampling](#orthogonal-sampling)
- [Sequential Selection](#sequential-selection)
- [Threshold Convergence](#threshold-convergence)
- [Sample Sigma](#sample-sigma)
- [Base Sampler](#base-sampler)
- [Recombination Weights](#recombination-weights)
- [Mirrored Sampling](#mirrored-sampling)
- [Step size adaptation](#step-size-adaptation)
- [Restart Strategy](#restart-strategy)
- [Bound Correction](#bound-correction)
4. [Citation](#citation)
5. [License](#license)
- [ModularCMAES ](#modularcmaes---)
- [Table of Contents](#table-of-contents)
- [Installation ](#installation-)
- [Python Installation](#python-installation)
- [Installation from source](#installation-from-source)
- [Usage ](#usage-)
- [Python-only ](#python-only-)
- [Ask-Tell Interface ](#ask-tell-interface-)
- [C++ Backend ](#c-backend-)
- [Modules ](#modules-)
- [Matrix Adaptation ](#matrix-adaptation-)
- [Active Update ](#active-update-)
- [Elitism ](#elitism-)
- [Orthogonal Sampling ](#orthogonal-sampling-)
- [Sequential Selection ](#sequential-selection-)
- [Threshold Convergence ](#threshold-convergence-)
- [Sample Sigma ](#sample-sigma-)
- [Quasi-Gaussian Sampling ](#quasi-gaussian-sampling-)
- [Recombination Weights ](#recombination-weights-)
- [Mirrored Sampling ](#mirrored-sampling-)
- [Step size adaptation](#step-size-adaptation)
- [Restart Strategy](#restart-strategy)
- [Bound correction](#bound-correction)
- [Citation ](#citation-)
- [License ](#license-)

## Installation <a name="installation"></a>

Expand Down Expand Up @@ -184,7 +188,7 @@ while not cma.break_conditions():
cma.mutate(func)
cma.select()
cma.recombine()
cma.adapt(func)
cma.adapt()
```

## Modules <a name="modules"></a>
Expand Down
6 changes: 6 additions & 0 deletions include/c_maes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ struct ModularCMAES

void recombine() const;

void select() const;

void adapt() const;

void mutate(FunctionType &objective) const;

bool step(FunctionType& objective) const;

void operator()(FunctionType& objective) const;
Expand Down
6 changes: 3 additions & 3 deletions include/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <Eigen/Eigenvalues>
#include <Eigen/QR>

using Float = long double;
using Float = double;
using Matrix = Eigen::Matrix<Float, -1, -1>;
using Vector = Eigen::Matrix<Float, -1, 1>;
using Array = Eigen::Array<Float, -1, 1>;
Expand All @@ -35,9 +35,9 @@ using FunctionType = std::function<Float(const Vector &)>;

namespace constants
{
extern Float tolup_sigma;
extern Float max_dsigma;
extern Float min_dsigma;
extern Float tol_condition_cov;
extern Float tol_min_sigma;
extern Float stagnation_quantile;
extern Float sigma_threshold;
extern size_t cache_max_doubles;
Expand Down
16 changes: 11 additions & 5 deletions include/parameters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
#include "mutation.hpp"
#include "population.hpp"
#include "matrix_adaptation.hpp"
#include "restart.hpp"
#include "restart_strategy.hpp"
#include "restart_criteria.hpp"
#include "sampling.hpp"
#include "stats.hpp"
#include "selection.hpp"
Expand All @@ -16,6 +17,8 @@ namespace parameters
{
struct Parameters
{
bool successfull_adaptation;

size_t lambda;
size_t mu;

Expand All @@ -26,23 +29,26 @@ namespace parameters
Population pop;
Population old_pop;

restart::Criteria criteria;
std::shared_ptr<sampling::Sampler> sampler;
std::shared_ptr<matrix_adaptation::Adaptation> adaptation;
std::shared_ptr<mutation::Strategy> mutation;
std::shared_ptr<selection::Strategy> selection;
std::shared_ptr<restart::Strategy> restart;
std::shared_ptr<restart::Strategy> restart_strategy;
std::shared_ptr<bounds::BoundCorrection> bounds;
std::shared_ptr<repelling::Repelling> repelling;
std::shared_ptr<center::Placement> center_placement;

Parameters(const size_t dim);

Parameters(const Settings &settings);

void adapt(FunctionType& objective);

void start(FunctionType& objective);

void perform_restart(FunctionType& objective, const std::optional<Float> &sigma = std::nullopt);
void adapt();

bool invalid_state() const;
void perform_restart(FunctionType& objective, const std::optional<Float> &sigma = std::nullopt);
};

}
Expand Down
174 changes: 0 additions & 174 deletions include/restart.hpp

This file was deleted.

Loading