Chaotic Optimization

Chaotic Optimization

class Chaotic_optimization(search_space, f_calls, chaos_map=<class 'zellij.strategies.tools.chaos_map.Henon'>, exploration_ratio=0.3, levels=(32, 6, 2), polygon=4, red_rate=0.5, verbose=True)[source]

Bases: zellij.core.metaheuristic.Metaheuristic

Chaotic optimization combines CGS, CLS and CFS.

chaos_map

If a string is given, the algorithm will select the corresponding map. The chaotic map is used to sample points. If it is a map, it will directly use it. Be carefull, the map size must be sufficient according to the parametrization.

Type

{‘henon’, ‘kent’, ‘tent’, ‘logistic’, ‘random’, Chaos_map}

exploration_ratio

It will determine the number of calls to the loss function dedicated to exploration and exploitation, according to chaotic levels associated to CGS, CLS and CFS.

Type

float

polygon

Vertex number of the rotating polygon (has an influence on the number of evaluated points) for CLS and CFS

Type

int

red_rate

Reduction rate of the progressive zoom on the best solution found for CLS and CFS

Type

float

CGS_level

Number of chaotic level associated to CGS

Type

int

CLS_level

Number of chaotic level associated to CLS

Type

int

CFS_level

Number of chaotic level associated to CFS

Type

int

verbose

Algorithm verbosity

Type

boolean, default=True

run(self, n_process=1)[source]

Runs Chaotic_optimization

See also

Metaheuristic

Parent class defining what a Metaheuristic is

CGS

Chaotic Global Search

CLS

Chaotic Local Search

CFS

Chaotic Fine Search

Examples

>>> from zellij.core import Loss
>>> from zellij.core import ContinuousSearchspace
>>> from zellij.core import FloatVar, ArrayVar
>>> from zellij.strategies import Chaotic_optimization
>>> from zellij.utils.benchmark import himmelblau
...
>>> lf = Loss()(himmelblau)
>>> sp = ContinuousSearchspace(ArrayVar(FloatVar("a",-5,5), FloatVar("b",-5,5)),lf)
>>> co = Chaotic_optimization(sp, 1000)
>>> co.run()
run(H=None, n_process=1)[source]

Runs the Chaotic_optimization

Parameters
  • H (Fractal, default=None) – When used by Decomposition Based Algorithm, a fractal corresponding to the current subspace is given

  • n_process (int, default=1) – Determine the number of best solution found to return.

Returns

  • best_sol (list[float]) – Returns a list of the n_process best found points to the continuous format

  • best_scores (list[float]) – Returns a list of the n_process best found scores associated to best_sol

Chaos maps

class Chaos_map(vectors, params)[source]

Bases: object

Chaos_map is in abstract class describing what a chaos map is.

vectors

Size of the map (rows).

Type

int

params

Number of parameters (columns).

Type

int

map

Chaos map of shape (vectors, params).

Type

np.array

See also

Chaotic_optimization

Chaos map is used here.

class Henon(vectors, params, a=1.402056, b=0.305620406)[source]

Bases: zellij.strategies.tools.chaos_map.Chaos_map

Henon chaotic map

\smash{
\begin{cases}
\begin{cases}
x_{n+1} = 1 - a x_n^2 + y_n\\
y_{n+1} = b x_n.
\end{cases}\\
map = \frac{y-min(y)}{max(y)-min(y)}
\end{cases}}

Parameters
  • vectors (int) – Map size

  • params (int) – Number of dimensions

  • a (float, default=1.4020560) – Henon map parameter. Has an influence on the chaotic, intermittent or periodicity behaviors.

  • b (float, default=0.305620406) – Henon map parameter. Has an influence on the chaotic, intermittent or periodicity behaviors.

map

Chaos map of size (vectors,param)

Type

numpy.ndarray

class Kent(vectors, params, beta=0.8)[source]

Bases: zellij.strategies.tools.chaos_map.Chaos_map

Kent chaotic map

\smash{
\begin{cases}
x_{n+1} =
\begin{cases}
\frac{x_n}{\beta} \quad 0 < x_{n}  \leq \beta \\
\frac{1-x_n}{1-\beta} \quad \beta < x_{n} \leq 1
\end{cases}\\
map=x
\end{cases}}

Parameters
  • vectors (int) – Map size

  • params (int) – Number of dimensions

  • beta (float, default=0.8) – Kent map parameter. Has an influence on the chaotic, intermittent, convergence, or periodicity behaviors.

map

Chaos map of size (vectors,param)

Type

numpy.ndarray

class Logistic(vectors, params, mu=3.57)[source]

Bases: zellij.strategies.tools.chaos_map.Chaos_map

Logistic chaotic map

\smash{
\begin{cases}
x_{n+1} = \mu x_n(1-x_n)\\
map=x
\end{cases}}

Parameters
  • vectors (int) – Map size

  • params (int) – Number of dimensions

  • mu (float, default=3.57) – Logistic map parameter. Has an influence on the chaotic, intermittent, convergence, or periodicity behaviors.

map

Chaos map of size (vectors,param)

Type

numpy.ndarray

class Tent(vectors, params, mu=1.9999999999)[source]

Bases: zellij.strategies.tools.chaos_map.Chaos_map

Tent chaotic map

\smash{
\begin{cases}
x_{n+1} =
\begin{cases}
\mu x_n     \quad x_n < \frac{1}{2} \\
\mu (1-x_n) \quad \frac{1}{2} \leq x_n
\end{cases}\\
map = x
\end{cases}}

Parameters
  • vectors (int) – Map size

  • params (int) – Number of dimensions

  • Tent (float, default=1.9999999999) – Logistic map parameter. Has an influence on the chaotic, intermittent, convergence, or periodicity behaviors.

map

Chaos map of size (vectors,param)

Type

numpy.ndarray

class Random(vectors, params)[source]

Bases: zellij.strategies.tools.chaos_map.Chaos_map