evox.problems.numerical

子模块

软件包内容

Ackley

Ackley 函数的最小值为 x = [0, ..., 0]

Griewank

Griewank 函数的最小值是 x = [0, ..., 0]

Rastrigin

Rastrigin 函数的最小值是 x = [0, ..., 0]

Rosenbrock

Rosenbrock 函数的最小值为 x = [1, ..., 1]

Schwefel

Schwefel 函数的最小值为 x = [420.9687, ..., 420.9687]

Sphere

球体函数(sphere function),其最小值为 x = [0, ..., 0]

Ellipsoid

椭球函数,其最小值为 x = [0, ..., 0]

CEC2022

CEC 2022 单目标测试套件问题

DTLZ1

DTLZ2

DTLZ3

DTLZ4

DTLZ5

DTLZ6

DTLZ7

函数

API

class evox.problems.numerical.Ackley(a: float = 20.0, b: float = 0.2, c: float = 2 * torch.pi, **kwargs)[源代码]

Bases: evox.problems.numerical.basic.ShiftAffineNumericalProblem

Ackley 函数的最小值为 x = [0, ..., 0]

初始化

用给定的参数初始化 Ackley 函数。

参数:
  • a -- 方程中的参数a。默认值为20.0。

  • b -- 方程中的参数 b。默认值为 0.2。

  • c -- 方程中的参数c。默认值为2 * pi。

  • **kwargs -- 传递给超类 ShiftAffineNumericalProblem 的关键字参数(shift 和 affine)。

_true_evaluate(x: torch.Tensor) torch.Tensor[源代码]
class evox.problems.numerical.Griewank(**kwargs)[源代码]

Bases: evox.problems.numerical.basic.ShiftAffineNumericalProblem

Griewank 函数的最小值是 x = [0, ..., 0]

初始化

用给定的参数初始化 Griewank 函数。

参数:

**kwargs -- 传递给超类 ShiftAffineNumericalProblem 的关键字参数(shift 和 affine)。

_true_evaluate(x: torch.Tensor) torch.Tensor[源代码]
class evox.problems.numerical.Rastrigin(**kwargs)[源代码]

Bases: evox.problems.numerical.basic.ShiftAffineNumericalProblem

Rastrigin 函数的最小值是 x = [0, ..., 0]

初始化

用给定的参数初始化 Griewank 函数。

参数:

**kwargs -- 传递给超类 ShiftAffineNumericalProblem 的关键字参数(shift 和 affine)。

_true_evaluate(x: torch.Tensor) torch.Tensor[源代码]
class evox.problems.numerical.Rosenbrock(**kwargs)[源代码]

Bases: evox.problems.numerical.basic.ShiftAffineNumericalProblem

Rosenbrock 函数的最小值为 x = [1, ..., 1]

初始化

用给定的参数初始化 Griewank 函数。

参数:

**kwargs -- 传递给超类 ShiftAffineNumericalProblem 的关键字参数(shift 和 affine)。

_true_evaluate(x: torch.Tensor) torch.Tensor[源代码]
class evox.problems.numerical.Schwefel(**kwargs)[源代码]

Bases: evox.problems.numerical.basic.ShiftAffineNumericalProblem

Schwefel 函数的最小值为 x = [420.9687, ..., 420.9687]

初始化

用给定的参数初始化 Griewank 函数。

参数:

**kwargs -- 传递给超类 ShiftAffineNumericalProblem 的关键字参数(shift 和 affine)。

_true_evaluate(x: torch.Tensor) torch.Tensor[源代码]
class evox.problems.numerical.Sphere(**kwargs)[源代码]

Bases: evox.problems.numerical.basic.ShiftAffineNumericalProblem

球体函数(sphere function),其最小值为 x = [0, ..., 0]

初始化

用给定的参数初始化 Griewank 函数。

参数:

**kwargs -- 传递给超类 ShiftAffineNumericalProblem 的关键字参数(shift 和 affine)。

_true_evaluate(x: torch.Tensor) torch.Tensor[源代码]
class evox.problems.numerical.Ellipsoid(**kwargs)[源代码]

Bases: evox.problems.numerical.basic.ShiftAffineNumericalProblem

椭球函数,其最小值为 x = [0, ..., 0]

初始化

使用给定参数初始化 Ellipsoid 函数。

参数:

**kwargs -- 传递给超类 ShiftAffineNumericalProblem 的关键字参数(shift 和 affine)。

_true_evaluate(x: torch.Tensor) torch.Tensor[源代码]
class evox.problems.numerical.CEC2022(problem_number: int, dimension: int, device: torch.device | None = None)[源代码]

Bases: evox.core.Problem

CEC 2022 单目标测试套件问题

初始化

从CEC2022测试套件初始化一个单一测试函数实例。

参数:
  • problem_number -- 特定测试函数的索引。必须在1到12之间。

  • (int) (dimension) -- 问题的维度。必须是 [2, 10, 20] 之一。

  • optional) (device (torch.device,) -- 张量将被分配的设备。默认值为 None。

抛出:
  • AssertionError -- 如果维度不是允许的值之一,或者函数未定义。

  • FileNotFoundError -- 如果未找到该问题所需的数据文件。

shift(x: torch.Tensor, offset: torch.Tensor) torch.Tensor[源代码]

将输入向量移位。

rotate(x: torch.Tensor, M: torch.Tensor) torch.Tensor[源代码]

旋转输入向量。

cut(x: torch.Tensor, Gp: List[float], sh_flag: bool, rot_flag: bool, offset: torch.Tensor, M: torch.Tensor) List[torch.Tensor][源代码]
sr_func_rate(x: torch.Tensor, sh_rate: float, sh_flag: bool, rot_flag: bool, offset: torch.Tensor, M: torch.Tensor) torch.Tensor[源代码]

平移和旋转函数与速率。

cf_cal(x: torch.Tensor, fit: List[torch.Tensor], delta: List[int], bias: List[int]) torch.Tensor[源代码]
cec2022_f1(x: torch.Tensor) torch.Tensor[源代码]

Zakharov 函数

cec2022_f2(x: torch.Tensor) torch.Tensor[源代码]

Rosenbrock Function

cec2022_f3(x: torch.Tensor) torch.Tensor[源代码]

Schaffer F7 函数

cec2022_f4(x: torch.Tensor) torch.Tensor[源代码]

Rastrigin 函数步骤(不连续的 Rastrigin's)

cec2022_f5(x: torch.Tensor) torch.Tensor[源代码]

Levy Function
Levy Function

cec2022_f6(x: torch.Tensor) torch.Tensor[源代码]

混合函数2

cec2022_f7(x: torch.Tensor) torch.Tensor[源代码]

混合函数 10

cec2022_f8(x: torch.Tensor) torch.Tensor[源代码]

混合函数6

cec2022_f9(x: torch.Tensor) torch.Tensor[源代码]

Composition Function 1

cec2022_f10(x: torch.Tensor) torch.Tensor[源代码]

Composition Function 2

cec2022_f11(x: torch.Tensor) torch.Tensor[源代码]

Composition Function 6

cec2022_f12(x: torch.Tensor) torch.Tensor[源代码]

Composition Function 7

zakharov_func(x: torch.Tensor) torch.Tensor[源代码]

问题编号 = 1。

step_rastrigin_func(x: torch.Tensor) torch.Tensor[源代码]

问题编号 = 4。

levy_func(x: torch.Tensor) torch.Tensor[源代码]

问题编号 = 5。

bent_cigar_func(x: torch.Tensor) torch.Tensor[源代码]
hgbat_func(x: torch.Tensor) torch.Tensor[源代码]
rastrigin_func(x: torch.Tensor) torch.Tensor[源代码]
katsuura_func(x: torch.Tensor) torch.Tensor[源代码]
ackley_func(x: torch.Tensor) torch.Tensor[源代码]
schwefel_func(x: torch.Tensor) torch.Tensor[源代码]
schaffer_F7_func(x: torch.Tensor) torch.Tensor[源代码]
escaffer6_func(x: torch.Tensor) torch.Tensor[源代码]
happycat_func(x: torch.Tensor) torch.Tensor[源代码]
grie_rosen_func(x: torch.Tensor) torch.Tensor[源代码]
griewank_func(x: torch.Tensor) torch.Tensor[源代码]
rosenbrock_func(x: torch.Tensor) torch.Tensor[源代码]
discus_func(x: torch.Tensor) torch.Tensor[源代码]
ellips_func(x: torch.Tensor) torch.Tensor[源代码]
evaluate(pop: torch.Tensor) torch.Tensor[源代码]
class evox.problems.numerical.DTLZ1(d: int = 7, m: int = 3, ref_num: int = 1000)[源代码]

Bases: evox.problems.numerical.dtlz.DTLZ

evaluate(X: torch.Tensor) torch.Tensor[源代码]
class evox.problems.numerical.DTLZ2(d: int = 12, m: int = 3, ref_num: int = 1000)[源代码]

Bases: evox.problems.numerical.dtlz.DTLZ

evaluate(X: torch.Tensor) torch.Tensor[源代码]
pf()[源代码]
class evox.problems.numerical.DTLZ3(d: int = 12, m: int = 3, ref_num: int = 1000)[源代码]

Bases: evox.problems.numerical.dtlz.DTLZ2

evaluate(X: torch.Tensor) torch.Tensor[源代码]
class evox.problems.numerical.DTLZ4(d: int = 12, m: int = 3, ref_num: int = 1000)[源代码]

Bases: evox.problems.numerical.dtlz.DTLZ2

evaluate(X: torch.Tensor) torch.Tensor[源代码]
class evox.problems.numerical.DTLZ5(d: int = 12, m: int = 3, ref_num: int = 1000)[源代码]

Bases: evox.problems.numerical.dtlz.DTLZ

evaluate(X: torch.Tensor) torch.Tensor[源代码]
pf()[源代码]
class evox.problems.numerical.DTLZ6(d: int = 12, m: int = 3, ref_num: int = 1000)[源代码]

Bases: evox.problems.numerical.dtlz.DTLZ

evaluate(X: torch.Tensor) torch.Tensor[源代码]
pf()[源代码]
class evox.problems.numerical.DTLZ7(d: int = 21, m: int = 3, ref_num: int = 1000)[源代码]

Bases: evox.problems.numerical.dtlz.DTLZ

evaluate(X: torch.Tensor) torch.Tensor[源代码]
pf()[源代码]
evox.problems.numerical.ackley_func(a: float, b: float, c: float, x: torch.Tensor) torch.Tensor[源代码]
evox.problems.numerical.griewank_func(x: torch.Tensor) torch.Tensor[源代码]
evox.problems.numerical.rastrigin_func(x: torch.Tensor) torch.Tensor[源代码]
evox.problems.numerical.rosenbrock_func(x)[源代码]
evox.problems.numerical.schwefel_func(x)[源代码]
evox.problems.numerical.sphere_func(x)[源代码]
evox.problems.numerical.ellipsoid_func(x: torch.Tensor)[源代码]