Skip to content
Open
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
90 changes: 67 additions & 23 deletions docs/src/performant_algs/egor.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Egor in modOpt currently requires finite lower and upper bounds on every design
Problems with unbounded variables are rejected.
```

Before using `Egor`, install `egobox`:
Before using `Egor`, install `egobox` (version 0.38 or later):

```sh
pip install egobox
Expand All @@ -43,7 +43,9 @@ optimizer = Egor(prob, solver_options={"max_iters": 50, "n_doe": 10, "seed": 42}
modOpt forwards Egor options through two paths:

- constructor options are passed to `egobox.Egor(...)`
- runtime options are passed to `Egor.minimize(...)`
- runtime options (`max_iters`, `seed`, `outdir`, `warm_start`, `hot_start`,
`run_info`, `timeout`, `verbose`, `stop_on_error`, `fcstrs`, `fcstr_specs`)
are passed to `Egor.minimize(...)`

```{note}
For constrained problems, do not pass `solver_options['cstr_specs']` directly.
Expand All @@ -62,31 +64,46 @@ The modOpt wrapper builds `cstr_specs` automatically from `cl` and `cu`.
- Maximum number of Egor iterations. Passed to \
`minimize()`.
* - `gp_config`
- *egobox.GpConfig*
- *egobox.GpConfig*, *dict*, or `None` (`None`)
- GP configuration used by the optimizer, see \
GpConfig for details.
* - `n_start`
- *int* (`20`)
GpConfig for details. When `None`, the egobox \
default is used.
* - `infill_n_start`
- *int* or `None` (`None`)
- Number of runs of infill strategy optimizations; \
the best result is taken.
the best result is taken. When `None`, the \
egobox default is used. Replaces the deprecated \
`n_start` option.
* - `n_doe`
- *int* (`0`)
- Number of samples of initial LHS sampling, used \
when DOE is not provided by the user. When 0, \
the number of points is computed automatically \
regarding the number of input variables of the \
function under optimization.
* - `doe`
* - `x_doe`
- *None*, *list*, *tuple*, or *ndarray* (`None`)
- Initial DOE inputs, shape `(ns, nx)`. When \
`y_doe` is not given, the `ns` points are \
evaluated first. Replaces the deprecated `doe` \
option (`doe[:, :nx]`).
* - `y_doe`
- *None*, *list*, *tuple*, or *ndarray* (`None`)
- Initial DOE containing `ns` samples. Either \
`nt = nx` then only `x` is specified and `ns` \
evaluations are done to get `y_doe` values, or \
`nt = nx + ny` then `x = doe[:, :nx]` and \
`y = doe[:, nx:]` are provided.
- Outputs at `x_doe`, shape `(ns, 1 + n_cstr)`: \
the objective, then the raw values of the \
modOpt constraints with at least one finite \
bound, in order. Requires `x_doe`.
* - `infill_strategy`
- *egobox.InfillStrategy* (`LOG_EI`)
- Infill criterion used to decide the next \
promising point.
* - `feasible_infill_strategy`
- *egobox.FeasibleInfillStrategy* (`NONE`)
- Strategy to take feasibility into account in the \
infill criterion (Expected Feasible Improvement): \
`NONE`, `EFI_P`, or `EFI_FE`. `EFI_P` and \
`EFI_FE` require `infill_strategy` to be `EI`, \
`WB2`, or `WB2S`.
* - `cstr_infill`
- *bool* (`False`)
- Activates the constrained infill criterion, \
Expand All @@ -97,7 +114,7 @@ The modOpt wrapper builds `cstr_specs` automatically from `cl` and `cu`.
- Constraint management strategy for infill; use \
the mean value or the upper trusted bound.
* - `qei_config`
- *egobox.QEiConfig*
- *egobox.QEiConfig*, *dict*, or `None` (`None`)
- Configuration for parallel qEI, also known as \
batch or multipoint evaluation. `q` points are \
selected at each iteration of the EGO algorithm.
Expand All @@ -114,11 +131,14 @@ The modOpt wrapper builds `cstr_specs` automatically from `cl` and `cu`.
- Number of cooperative component groups used by \
the CoEGO algorithm.
* - `target`
- *float* (`-max_float`)
- Known optimum used as a stopping criterion.
- *float* or `None` (`None`)
- Known optimum used as a stopping criterion. \
When `None`, no target is used.
* - `failsafe_strategy`
- *egobox.FailsafeStrategy* (`REJECTION`)
- Strategy to handle objective computation failure.
- Strategy to handle objective computation failure \
(NaN values or errors): `REJECTION`, \
`IMPUTATION`, or `VIABILITY`.
* - `seed`
- *int* or `None` (`None`)
- Random generator seed to allow computation \
Expand All @@ -131,7 +151,7 @@ The modOpt wrapper builds `cstr_specs` automatically from `cl` and `cu`.
- *bool* (`False`)
- Start by loading initial DOE from `outdir`.
* - `hot_start`
- *int* or `None` (`None`)
- *bool*, *int*, or `None` (`None`)
- When `True`, `hot_start` behaves like \
`hot_start = 0` with no iteration extension. \
When `hot_start >= 0`, the optimizer state is \
Expand All @@ -147,15 +167,29 @@ The modOpt wrapper builds `cstr_specs` automatically from `cl` and `cu`.
stops when the elapsed time exceeds this \
duration.
* - `verbose`
- *int*, *egobox.Verbosity*, or `None` (`None`)
- *int*, *egobox.Verbose*, or `None` (`None`)
- Logging verbosity level. Default is `None`, \
which means `Verbose.ERROR` and possible \
control by the `EGOBOX_LOG` environment \
variable.
* - `cstr_tol`
- *None*, *list*, *tuple*, or *ndarray* (`None`)
- List of tolerances for constraints to be \
satisfied (`cstr < tol`).
* - `stop_on_error`
- *bool* (`False`)
- If `True`, terminate the optimization when the \
objective function raises an error. Otherwise, \
the error is handled according to \
`failsafe_strategy`.
* - `cstr_tols`
- *None*, *float*, *list*, *tuple*, or *ndarray* \
(`None`)
- Constraint violation tolerances: a scalar, or one \
value per modOpt constraint with at least one \
finite bound. Each one is set as the tolerance \
of the corresponding `CstrSpec`. Use `CstrSpec` \
tolerances in `fcstr_specs` for function \
constraints. For equality and double-sided \
constraints, the single value applies to both \
internal `c(x) <= 0` constraints. Replaces the \
deprecated `cstr_tol` option.
* - `cstr_specs`
- *None*, *list*, or *tuple* (`None`)
- Optional list of `CstrSpec` objects describing \
Expand All @@ -170,10 +204,20 @@ The modOpt wrapper builds `cstr_specs` automatically from `cl` and `cu`.
function constraint.
```

```{note}
`n_start`, `doe` and `cstr_tol` are deprecated, use `infill_n_start`, `x_doe`/`y_doe`
and `cstr_tols` instead.
They still work but emit a `DeprecationWarning`.
```

In the results, `y_doe` holds the objective followed by the raw values of the
modOpt constraints with at least one finite bound, as for the `y_doe` option.

```{note}
Detailed information on `egobox` objects can be retrieved using the python interpreter. See example below.
```
```bash
> python
>>> import egobox
>>> help(egobox.GpConfig)
```
2 changes: 1 addition & 1 deletion modopt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '0.3.1'
__version__ = '0.4.0'

# import modopt base classes
from modopt.core.optimizer import Optimizer
Expand Down
Loading
Loading