tf.train.SecondOrStepTimer

Class SecondOrStepTimer

Defined in tensorflow/python/training/basic_session_run_hooks.py.

Timer that triggers at most once every N seconds or once every N steps.

Methods

__init__

__init__(
    every_secs=None,
    every_steps=None
)

last_triggered_step

last_triggered_step()

reset

reset()

should_trigger_for_step

should_trigger_for_step(step)

Return true if the timer should trigger for the specified step.

Args:

  • step: Training step to trigger on.

Returns:

True if the difference between the current time and the time of the last trigger exceeds every_secs, or if the difference between the current step and the last triggered step exceeds every_steps. False otherwise.

update_last_triggered_step

update_last_triggered_step(step)