Standard Names to Use for Graph Collections
The standard library uses various well-known names to collect and retrieve values associated with a graph.
graph_keys()Details
For example, the tf$Optimizer subclasses default to optimizing the
variables collected undergraph_keys()$TRAINABLE_VARIABLES if NULL 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$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$trainable_variablesfor more details.SUMMARIES: the summaryTensorobjects that have been created in the graph. Seetf$summary$merge_allfor more details.QUEUE_RUNNERS: theQueueRunnerobjects that are used to produce input for a computation. Seetf$train$start_queue_runnersfor more details.MOVING_AVERAGE_VARIABLES: the subset ofVariableobjects that will also keep moving averages. Seetf$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
See also
Other utility functions: latest_checkpoint
Examples
# NOT RUN {
graph_keys()
graph_keys()$LOSSES
# }