pytorch_pfn_extras.training.triggers.function_trigger.FunctionTrigger#
- class pytorch_pfn_extras.training.triggers.function_trigger.FunctionTrigger(fn, args=None, kwargs=None, trigger=(1, 'iteration'))#
Bases:
Trigger
Methods
__init__
(fn[, args, kwargs, trigger])load_state_dict
(to_load)may_fire
(iteration, epoch_len)Flags if the trigger may fire at the current iteration
- Parameters:
fn (Callable[[...], bool]) –
args (Optional[Sequence[Any]]) –
kwargs (Optional[Mapping[str, Any]]) –
trigger (TriggerLike) –
- __call__(manager)#
Call self as a function.
- Parameters:
manager (ExtensionsManagerProtocol) –
- Return type:
bool
- __init__(fn, args=None, kwargs=None, trigger=(1, 'iteration'))#
- Parameters:
fn (Callable[[...], bool]) –
args (Optional[Sequence[Any]]) –
kwargs (Optional[Mapping[str, Any]]) –
trigger (TriggerLike) –
- Return type:
None
- load_state_dict(to_load)#
- Parameters:
to_load (Dict[str, Any]) –
- Return type:
None
- may_fire(iteration, epoch_len)#
Flags if the trigger may fire at the current iteration
This must not alter the trigger state
- Parameters:
iteration (int) –
epoch_len (int) –
- Return type:
bool
- state_dict()#
- Return type:
Dict[str, Any]