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

Adding AGEMOEA and IGD #399

Merged
merged 31 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
de8cbe5
Initialized agemoea and igd
IWNMWE May 31, 2024
745f741
added SBX and normalization
IWNMWE Jun 1, 2024
5622db0
polynomial mutation and error fixes
IWNMWE Jun 2, 2024
21b084c
Added Survival Score and optimization loop
IWNMWE Jun 11, 2024
5e44e55
fixed typos
IWNMWE Jun 11, 2024
ce6a64c
error fixes
IWNMWE Jun 15, 2024
8969f73
bounds on c1 and c2 added
IWNMWE Jun 16, 2024
9f25ae2
Added agemoea_test
IWNMWE Jun 25, 2024
7ec24a3
removed comments
IWNMWE Jun 26, 2024
1466ee5
Returns final paretoSet
IWNMWE Jun 29, 2024
c0bae8c
style changes
IWNMWE Jul 2, 2024
1bee1cc
style fixes
IWNMWE Jul 2, 2024
2c909bb
resolved clamp error
IWNMWE Jul 3, 2024
3bdfc75
Reviewed changes
IWNMWE Jul 5, 2024
ff72db8
update test params
IWNMWE Jul 8, 2024
4e90dcb
Added documentation
IWNMWE Jul 9, 2024
be5bc43
added more tries to ZDT3
IWNMWE Jul 10, 2024
fb4149e
Documentation changes
IWNMWE Jul 10, 2024
ad9e80f
Updated ensmallen.hpp
IWNMWE Jul 11, 2024
e32ef1b
style fixes
IWNMWE Jul 24, 2024
4095b1f
change in nsga2 documentation
IWNMWE Jul 24, 2024
b4fb3d7
change file path
IWNMWE Jul 24, 2024
6a7f048
Added documentation and style fixes
IWNMWE Jul 26, 2024
762b14e
style fixes
IWNMWE Jul 26, 2024
d9495a9
Fixed nsga2 documentation
IWNMWE Jul 26, 2024
77c6fe4
Added colab link
IWNMWE Jul 26, 2024
af14105
increase re tries for zdt3
IWNMWE Jul 27, 2024
b1b51d2
ZDT3 test population percentage checks
IWNMWE Jul 27, 2024
6db63f3
Documentation changes
IWNMWE Jul 27, 2024
1aea611
Documentation changes
IWNMWE Jul 28, 2024
b87cb77
Remove extra space
IWNMWE Jul 28, 2024
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
62 changes: 61 additions & 1 deletion doc/optimizers.md
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,66 @@ optimizer.Optimize(f, coordinates);
* [Adam: A Method for Stochastic Optimization](http://arxiv.org/abs/1412.6980) (see section 7)
* [Differentiable separable functions](#differentiable-separable-functions)

## AGEMOEA

*An optimizer for arbitrary multi-objective functions.*
IWNMWE marked this conversation as resolved.
Show resolved Hide resolved

Adaptive Geometry Estimation based Multi-Objective Evolutionary Algorithm (AGE-MOEA) is an optimization framework based on NSGA-II yet differs from it in replacing the crowding distance of NSGA-II by a survival score, for which calculations need the diversity and proximity of non-dominated sets. To simplify the computation of the survival score, in each generation, the geometry of the initial non-dominated subset is estimated by AGE-MOEA afterwards, this estimation which gets more accurate as the algorithm matures, is used as the geometry of the Pareto set
IWNMWE marked this conversation as resolved.
Show resolved Hide resolved

#### Constructors

* `AGEMOEA()`
* `AGEMOEA(`_`populationSize, maxGenerations, crossoverProb, distributionIndex, epsilon, eta, lowerBound, upperBound`_`)`

#### Attributes

| **type** | **name** | **description** | **default** |
|----------|----------|-----------------|-------------|
| `size_t` | **`populationSize`** | The number of candidates in the population. This should be at least 4 in size and a multiple of 4. | `100` |
| `size_t` | **`maxGenerations`** | The maximum number of generations allowed for AGEMOEA. | `2000` |
| `double` | **`crossoverProb`** | Probability that a crossover will occur. | `0.6` |
| `double` | **`distributionIndex`** | The crowding degree of the mutation. | `20` |
| `double` | **`epsilon`** | The value used internally to evaluate approximate equality in crowding distance based sorting. | `1e-6` |
| `double` | **`eta`** | The distance parameters of the crossover distribution. | `20` |
| `double`, `arma::vec` | **`lowerBound`** | Lower bound of the coordinates on the coordinates of the whole population during the search process. | `0` |
| `double`, `arma::vec` | **`upperBound`** | Lower bound of the coordinates on the coordinates of the whole population during the search process. | `1` |

Note that the parameters `lowerBound` and `upperBound` are overloaded. Data types of `double` or `arma::mat` may be used. If they are initialized as single values of `double`, then the same value of the bound applies to all the axes, resulting in an initialization following a uniform distribution in a hypercube. If they are initialized as matrices of `arma::mat`, then the value of `lowerBound[i]` applies to axis `[i]`; similarly, for values in `upperBound`. This results in an initialization following a uniform distribution in a hyperrectangle within the specified bounds.

Attributes of the optimizer may also be changed via the member methods
`PopulationSize()`, `MaxGenerations()`, `CrossoverRate()`, `DistributionIndex()`, `Eta()`, `Epsilon()`, `LowerBound()` and `UpperBound()`.

#### Examples

<details open>
<summary>Click to collapse/expand example code.
</summary>

```c++
SchafferFunctionN1<arma::mat> SCH;
arma::vec lowerBound("-1000");
arma::vec upperBound("1000");
AGEMOEA opt(50, 1000, 0.6, 20, 1e-6, 20, lowerBound, upperBound);

typedef decltype(SCH.objectiveA) ObjectiveTypeA;
typedef decltype(SCH.objectiveB) ObjectiveTypeB;

arma::mat coords = SCH.GetInitialPoint();
std::tuple<ObjectiveTypeA, ObjectiveTypeB> objectives = SCH.GetObjectives();

// obj will contain the minimum sum of objectiveA and objectiveB found on the best front.
double obj = opt.Optimize(objectives, coords);
// Now obtain the best front.
arma::cube bestFront = opt.ParetoFront();
```

</details>

#### See also:

* [An adaptive evolutionary algorithm based on non-euclidean geometry for many-objective optimization](https://doi.org/10.1145/3321707.3321839)
* [Wikipedia Multi-Objective optimization](https://www.google.com/url?sa=t&source=web&rct=j&opi=89978449&url=https://en.wikipedia.org/wiki/Multi-objective_optimization&ved=2ahUKEwjmnsj0lp2HAxVnzjgGHVWkCyUQFnoECB8QAQ&usg=AOvVaw0G76gxf9FiNUirlc4O_BCJ)
IWNMWE marked this conversation as resolved.
Show resolved Hide resolved

## AMSBound

*An optimizer for [differentiable separable functions](#differentiable-separable-functions).*
Expand Down Expand Up @@ -2107,7 +2167,7 @@ size equal to that of the starting population.
#### Constructors

* `NSGA2()`
* `NSGA2(`_`populationSize, maxGenerations, crossoverProb, mutationProb, mutationStrength, epsilon, lowerBound, upperBound`_`)`
IWNMWE marked this conversation as resolved.
Show resolved Hide resolved
* `NSGA2(`_`populationSize, maxGenerations, crossoverProb, distributionIndex, epsilon, eta, lowerBound, upperBound`_`)`
IWNMWE marked this conversation as resolved.
Show resolved Hide resolved

#### Attributes

Expand Down
2 changes: 2 additions & 0 deletions include/ensmallen.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
#include "ensmallen_bits/utility/any.hpp"
#include "ensmallen_bits/utility/arma_traits.hpp"
#include "ensmallen_bits/utility/indicators/epsilon.hpp"
#include "ensmallen_bits/utility/indicators/igd.hpp"
#include "ensmallen_bits/utility/indicators/igd_plus.hpp"

// Contains traits, must be placed before report callback.
Expand Down Expand Up @@ -111,6 +112,7 @@
#include "ensmallen_bits/katyusha/katyusha.hpp"
#include "ensmallen_bits/lbfgs/lbfgs.hpp"
#include "ensmallen_bits/lookahead/lookahead.hpp"
#include "ensmallen_bits/age_moea/agemoea.hpp"
#include "ensmallen_bits/moead/moead.hpp"
#include "ensmallen_bits/nsga2/nsga2.hpp"
#include "ensmallen_bits/padam/padam.hpp"
Expand Down
Loading