tf.GraphKeys
Standard names to use for graph collections.
The standard library uses various well-known names to collect and retrieve values associated with a graph. For example, the tf.Optimizer subclasses default to optimizing the variables collected under tf.GraphKeys.TRAINABLE_VARIABLES if none is specified, but it is also possible to pass an explicit list of variables.
The following standard keys are defined:
-
GLOBAL_VARIABLES: the default collection ofVariableobjects, shared across distributed environment (model variables are subset of these). Seetf.compat.v1.global_variablesfor more details. Commonly, allTRAINABLE_VARIABLESvariables will be inMODEL_VARIABLES, and allMODEL_VARIABLESvariables will be inGLOBAL_VARIABLES. -
LOCAL_VARIABLES: the subset ofVariableobjects that are local to each machine. Usually used for temporarily variables, like counters. Note: usetf.contrib.framework.local_variableto add to this collection. -
MODEL_VARIABLES: the subset ofVariableobjects that are used in the model for inference (feed forward). Note: usetf.contrib.framework.model_variableto add to this collection. -
TRAINABLE_VARIABLES: the subset ofVariableobjects that will be trained by an optimizer. Seetf.compat.v1.trainable_variablesfor more details. -
SUMMARIES: the summaryTensorobjects that have been created in the graph. Seetf.compat.v1.summary.merge_allfor more details. -
QUEUE_RUNNERS: theQueueRunnerobjects that are used to produce input for a computation. Seetf.compat.v1.train.start_queue_runnersfor more details. -
MOVING_AVERAGE_VARIABLES: the subset ofVariableobjects that will also keep moving averages. Seetf.compat.v1.moving_average_variablesfor more details. -
REGULARIZATION_LOSSES: regularization losses collected during graph construction.
The following standard keys are defined, but their collections are not automatically populated as many of the others are:
WEIGHTSBIASESACTIVATIONS
Class Variables
-
ACTIVATIONS = 'activations' -
ASSET_FILEPATHS = 'asset_filepaths' -
BIASES = 'biases' -
CONCATENATED_VARIABLES = 'concatenated_variables' -
COND_CONTEXT = 'cond_context' -
EVAL_STEP = 'eval_step' -
GLOBAL_STEP = 'global_step' -
GLOBAL_VARIABLES = 'variables' -
INIT_OP = 'init_op' -
LOCAL_INIT_OP = 'local_init_op' -
LOCAL_RESOURCES = 'local_resources' -
LOCAL_VARIABLES = 'local_variables' -
LOSSES = 'losses' -
METRIC_VARIABLES = 'metric_variables' -
MODEL_VARIABLES = 'model_variables' -
MOVING_AVERAGE_VARIABLES = 'moving_average_variables' -
QUEUE_RUNNERS = 'queue_runners' -
READY_FOR_LOCAL_INIT_OP = 'ready_for_local_init_op' -
READY_OP = 'ready_op' -
REGULARIZATION_LOSSES = 'regularization_losses' -
RESOURCES = 'resources' -
SAVEABLE_OBJECTS = 'saveable_objects' -
SAVERS = 'savers' -
SUMMARIES = 'summaries' -
SUMMARY_OP = 'summary_op' -
TABLE_INITIALIZERS = 'table_initializer' -
TRAINABLE_RESOURCE_VARIABLES = 'trainable_resource_variables' -
TRAINABLE_VARIABLES = 'trainable_variables' -
TRAIN_OP = 'train_op' -
UPDATE_OPS = 'update_ops' -
VARIABLES = 'variables' -
WEIGHTS = 'weights' -
WHILE_CONTEXT = 'while_context'
© 2020 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/GraphKeys