LambdaStoppingCriterion

class probnum.LambdaStoppingCriterion(stopcrit)

Bases: StoppingCriterion

Define a stopping criterion via an anonymous function.

Defines a stopping criterion from a lambda function. This allows quick definition of stopping criteria for prototyping.

Parameters:

stopcrit (Callable[[Any], bool]) – Callable returning whether to stop or not.

Examples

>>> from probnum import LambdaStoppingCriterion
>>> stopcrit = LambdaStoppingCriterion(lambda iters: iters >= 100)
>>> stopcrit(101)
True

Methods Summary

__call__(*args, **kwargs)

Check whether tracked quantities meet a desired terminal condition.

Methods Documentation

__call__(*args, **kwargs)[source]

Check whether tracked quantities meet a desired terminal condition.

Return type:

bool