optilab.functions package

Subpackages

Submodules

optilab.functions.noisy_function module

Class that makes an objective function noisy using random normal distribution.

class NoisyFunction(function: ObjectiveFunction, noise: float)[source]

Bases: ObjectiveFunction

Class that makes an objective function noisy using random normal distribution.

__init__(function: ObjectiveFunction, noise: float) None[source]

Class constructor.

Parameters:
  • function – Objective function to noise.

  • noise – Noise value of the function.

__call__(point: Point) Point[source]

Evaluate a single point with the objective function.

Parameters:

point – Point to be evaluated.

Raises:

ValueError – If dimensionality of x doesn’t match the dimensionality of the function.

Returns:

Evaluated point.

optilab.functions.objective_function module

Base class representing a callable objective function.

class ObjectiveFunction(name: str, dim: int, hyperparameters: Dict[str, Any] | None = None)[source]

Bases: object

Base class representing a callable objective function.

__init__(name: str, dim: int, hyperparameters: Dict[str, Any] | None = None) None[source]

Class constructor.

Parameters:
  • name – Name of the objective function.

  • dim – Dimensionality of the function.

  • hyperparameters – Dictionary with hyperparameters of the function.

__call__(point: Point) Point[source]

Evaluate a single point with the objective function.

Parameters:

point – Point to evaluate.

Raises:

ValueError – If dimensionality of x doesn’t match self.dim

Returns:

Evaluated point.

Module contents

Objective functions to be minimized by the optimizer.