tf.estimator.SecondOrStepTimer
Stay organized with collections
Save and categorize content based on your preferences.
Timer that triggers at most once every N seconds or once every N steps. (deprecated)
tf.estimator.SecondOrStepTimer(
every_secs=None, every_steps=None
)
Deprecated: THIS FUNCTION IS DEPRECATED. It will be removed in a future version.
Instructions for updating:
Use tf.keras instead.
This symbol is also exported to v2 in tf.estimator namespace. See
https://github.com/tensorflow/estimator/blob/master/tensorflow_estimator/python/estimator/hooks/basic_session_run_hooks.py
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.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license .
Last updated 2023-10-06 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
{"lastModified": "Last updated 2023-10-06 UTC."}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-10-06 UTC."],[],[]]