alogos._optimization.shared.evaluation

Classes

RobustCallable

Wrapper to make a function robust against failure and invalid return values.

Functions

default_evaluator(function, args)

Evaluate a given function on each item of a list.

get_robust_fitness_function(objective_function, objective)

Wrap a given function to make it robust.


Detailed object descriptions

alogos._optimization.shared.evaluation.default_evaluator(function, args)[source]

Evaluate a given function on each item of a list.

alogos._optimization.shared.evaluation.get_robust_fitness_function(objective_function, objective)[source]

Wrap a given function to make it robust.

class alogos._optimization.shared.evaluation.RobustCallable(func, def_fit, def_det)[source]

Wrapper to make a function robust against failure and invalid return values.

It provides following guarantees:

  • The return value is a tuple with two entries: (fitness, details)

  • fitness is ensured to be of type float, allowing +Inf and -Inf, but excluding NaN.

  • details can be any user-chosen type.

Notes

  • Simply wrapping the function into another function would cause pickling errors.

  • If the robust fitness function cannot be pickled, most parallel and distributed evaluation solutions cannot be applied since they rely on some pickling function.

References

__init__(self, func, def_fit, def_det)[source]

Create a robust callable object from a given function.