tf.estimator.SecondOrStepTimer

View source

Class SecondOrStepTimer

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

Aliases:

  • Class tf.compat.v1.estimator.SecondOrStepTimer
  • Class tf.compat.v1.train.SecondOrStepTimer
  • Class tf.compat.v2.estimator.SecondOrStepTimer

大牛时代配资This symbol is also exported to v2 in tf.estimator namespace. See

__init__

View source

__init__(
    every_secs=None,
    every_steps=None
)

大牛时代配资Initialize self. See help(type(self)) for accurate signature.

Methods

last_triggered_step

View source

last_triggered_step()

大牛时代配资Returns the last triggered time step or None if never triggered.

reset

View source

reset()

Resets the timer.

should_trigger_for_step

View source

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

View source

update_last_triggered_step(step)

Update the last triggered time and step number.

Args:

  • step: The current step.

Returns:

A pair (elapsed_time, elapsed_steps), where elapsed_time is the number of seconds between the current trigger and the last one (a float), and elapsed_steps is the number of steps between the current trigger and the last one. Both values will be set to None大牛时代配资 on the first trigger.

results matching ""

    No results matching ""