class, compare, trigger=(1, 'epoch'))[source]

Trigger invoked when specific value becomes best.

  • key (str) – Key of value.

  • compare (callable) – Compare function which takes current best value and new value and returns whether new value is better than current best.

  • trigger – Trigger that decides the comparison interval between current best value and new value. This must be a tuple in the form of <int>, 'epoch' or <int>, 'iteration' which is passed to IntervalTrigger.



Decides whether the extension should be called on this iteration.


trainer (Trainer) – Trainer object that this trigger is associated with. The observation of this trainer is used to determine if the trigger should fire.


True if the corresponding extension should be invoked in this iteration.

Return type


__eq__(value, /)

Return self==value.

__ne__(value, /)

Return self!=value.

__lt__(value, /)

Return self<value.

__le__(value, /)

Return self<=value.

__gt__(value, /)

Return self>value.

__ge__(value, /)

Return self>=value.