tf.compat.v1.ConditionalAccumulatorBase
Stay organized with collections
Save and categorize content based on your preferences.
A conditional accumulator for aggregating gradients.
tf.compat.v1.ConditionalAccumulatorBase(
dtype, shape, accumulator_ref
)
Up-to-date gradients (i.e., time step at which gradient was computed is
equal to the accumulator's time step) are added to the accumulator.
Extraction of the average gradient is blocked until the required number of
gradients has been accumulated.
Args |
dtype
|
Datatype of the accumulated gradients.
|
shape
|
Shape of the accumulated gradients.
|
accumulator_ref
|
A handle to the conditional accumulator, created by sub-
classes
|
Attributes |
accumulator_ref
|
The underlying accumulator reference.
|
dtype
|
The datatype of the gradients accumulated by this accumulator.
|
name
|
The name of the underlying accumulator.
|
Methods
num_accumulated
View source
num_accumulated(
name=None
)
Number of gradients that have currently been aggregated in accumulator.
Args |
name
|
Optional name for the operation.
|
Returns |
Number of accumulated gradients currently in accumulator.
|
set_global_step
View source
set_global_step(
new_global_step, name=None
)
Sets the global time step of the accumulator.
The operation logs a warning if we attempt to set to a time step that is
lower than the accumulator's own time step.
Args |
new_global_step
|
Value of new time step. Can be a variable or a constant
|
name
|
Optional name for the operation.
|
Returns |
Operation that sets the accumulator's time step.
|
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-03-17 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-03-17 UTC."],[],[]]