evox.problems.numerical.basic¶
Module Contents¶
Classes¶
A numerical problem with a shift and affine transformations to the input points. |
|
The Ackley function whose minimum is x = [0, …, 0] |
|
The Griewank function whose minimum is x = [0, …, 0] |
|
The Rastrigin function whose minimum is x = [0, …, 0] |
|
The Rosenbrock function whose minimum is x = [1, …, 1] |
|
The Schwefel function whose minimum is x = [420.9687, …, 420.9687] |
|
The sphere function whose minimum is x = [0, …, 0] |
|
The Ellipsoid function whose minimum is x = [0, …, 0] |
|
The Zakharov function whose minimum is x = [0, …, 0] |
|
The Levy function whose minimum is x = [1, …, 1] |
Functions¶
API¶
- class evox.problems.numerical.basic.ShiftAffineNumericalProblem(shift: torch.Tensor | None = None, affine: torch.Tensor | None = None)[source]¶
Bases:
evox.core.ProblemA numerical problem with a shift and affine transformations to the input points.
Initialization
Initialize the ShiftAffineNumericalProblem.
- Parameters:
shift – The shift vector. Defaults to None. None represents no shift.
affine – The affine transformation matrix. Defaults to None. None represents no affine transformation.
- evaluate(pop: torch.Tensor) torch.Tensor[source]¶
Evaluate the given population by shifting and applying an affine transformation to the input points first, and then evaluating the points with the actual function.
- Parameters:
pop – The population of points to evaluate.
- Returns:
The evaluated fitness of the population.
- class evox.problems.numerical.basic.Ackley(a: float = 20.0, b: float = 0.2, c: float = 2 * torch.pi, **kwargs)[source]¶
Bases:
evox.problems.numerical.basic.ShiftAffineNumericalProblemThe Ackley function whose minimum is x = [0, …, 0]
Initialization
Initialize the Ackley function with the given parameters.
- Parameters:
a – The parameter \(a\) in the equation. Defaults to 20.0.
b – The parameter \(b\) in the equation. Defaults to 0.2.
c – The parameter \(c\) in the equation. Defaults to 2 * pi.
**kwargs – The keyword arguments (
shiftandaffine) to pass to the superclassShiftAffineNumericalProblem.
- class evox.problems.numerical.basic.Griewank(**kwargs)[source]¶
Bases:
evox.problems.numerical.basic.ShiftAffineNumericalProblemThe Griewank function whose minimum is x = [0, …, 0]
Initialization
Initialize the Griewank function with the given parameters.
- Parameters:
**kwargs – The keyword arguments (
shiftandaffine) to pass to the superclassShiftAffineNumericalProblem.
- class evox.problems.numerical.basic.Rastrigin(**kwargs)[source]¶
Bases:
evox.problems.numerical.basic.ShiftAffineNumericalProblemThe Rastrigin function whose minimum is x = [0, …, 0]
Initialization
Initialize the Griewank function with the given parameters.
- Parameters:
**kwargs – The keyword arguments (
shiftandaffine) to pass to the superclassShiftAffineNumericalProblem.
- class evox.problems.numerical.basic.Rosenbrock(**kwargs)[source]¶
Bases:
evox.problems.numerical.basic.ShiftAffineNumericalProblemThe Rosenbrock function whose minimum is x = [1, …, 1]
Initialization
Initialize the Griewank function with the given parameters.
- Parameters:
**kwargs – The keyword arguments (
shiftandaffine) to pass to the superclassShiftAffineNumericalProblem.
- class evox.problems.numerical.basic.Schwefel(**kwargs)[source]¶
Bases:
evox.problems.numerical.basic.ShiftAffineNumericalProblemThe Schwefel function whose minimum is x = [420.9687, …, 420.9687]
Initialization
Initialize the Griewank function with the given parameters.
- Parameters:
**kwargs – The keyword arguments (
shiftandaffine) to pass to the superclassShiftAffineNumericalProblem.
- class evox.problems.numerical.basic.Sphere(**kwargs)[source]¶
Bases:
evox.problems.numerical.basic.ShiftAffineNumericalProblemThe sphere function whose minimum is x = [0, …, 0]
Initialization
Initialize the Griewank function with the given parameters.
- Parameters:
**kwargs – The keyword arguments (
shiftandaffine) to pass to the superclassShiftAffineNumericalProblem.
- class evox.problems.numerical.basic.Ellipsoid(**kwargs)[source]¶
Bases:
evox.problems.numerical.basic.ShiftAffineNumericalProblemThe Ellipsoid function whose minimum is x = [0, …, 0]
Initialization
Initialize the Ellipsoid function with the given parameters.
- Parameters:
**kwargs – The keyword arguments (
shiftandaffine) to pass to the superclassShiftAffineNumericalProblem.
- class evox.problems.numerical.basic.Zakharov(**kwargs)[source]¶
Bases:
evox.problems.numerical.basic.ShiftAffineNumericalProblemThe Zakharov function whose minimum is x = [0, …, 0]
Initialization
Initialize the Zakharov function with the given parameters.
- Parameters:
**kwargs – The keyword arguments (
shiftandaffine) to pass to the superclassShiftAffineNumericalProblem.
- class evox.problems.numerical.basic.Levy(**kwargs)[source]¶
Bases:
evox.problems.numerical.basic.ShiftAffineNumericalProblemThe Levy function whose minimum is x = [1, …, 1]
Initialization
Initialize the Levy function with the given parameters.
- Parameters:
**kwargs – The keyword arguments (
shiftandaffine) to pass to the superclassShiftAffineNumericalProblem.