Training
[TOC]
tf.train provides a set of classes and functions that help train models.
Optimizers
The Optimizer base class provides methods to compute gradients for a loss and apply gradients to variables. A collection of subclasses implement classic optimization algorithms such as GradientDescent and Adagrad.
You never instantiate the Optimizer class itself, but instead instantiate one of the subclasses.
tf.train.Optimizertf.train.GradientDescentOptimizertf.train.AdadeltaOptimizertf.train.AdagradOptimizertf.train.AdagradDAOptimizertf.train.MomentumOptimizertf.train.AdamOptimizertf.train.FtrlOptimizertf.train.ProximalGradientDescentOptimizertf.train.ProximalAdagradOptimizertf.train.RMSPropOptimizer
See tf.contrib.opt for more optimizers.
Gradient Computation
TensorFlow provides functions to compute the derivatives for a given TensorFlow computation graph, adding operations to the graph. The optimizer classes automatically compute derivatives on your graph, but creators of new Optimizers or expert users can call the lower-level functions below.
tf.gradientstf.AggregationMethodtf.stop_gradienttf.hessians
Gradient Clipping
TensorFlow provides several operations that you can use to add clipping functions to your graph. You can use these functions to perform general data clipping, but they're particularly useful for handling exploding or vanishing gradients.
tf.clip_by_valuetf.clip_by_normtf.clip_by_average_normtf.clip_by_global_normtf.global_norm
Decaying the learning rate
tf.train.exponential_decaytf.train.inverse_time_decaytf.train.natural_exp_decaytf.train.piecewise_constanttf.train.polynomial_decaytf.train.cosine_decaytf.train.linear_cosine_decaytf.train.noisy_linear_cosine_decay
Moving Averages
Some training algorithms, such as GradientDescent and Momentum often benefit from maintaining a moving average of variables during optimization. Using the moving averages for evaluations often improve results significantly.
tf.train.ExponentialMovingAverage
Coordinator and QueueRunner
See Threading and Queues for how to use threads and queues. For documentation on the Queue API, see Queues.
tf.train.Coordinatortf.train.QueueRunnertf.train.LooperThreadtf.train.add_queue_runnertf.train.start_queue_runners
Distributed execution
See Distributed TensorFlow for more information about how to configure a distributed TensorFlow program.
tf.train.Servertf.train.Supervisortf.train.SessionManagertf.train.ClusterSpectf.train.replica_device_settertf.train.MonitoredTrainingSessiontf.train.MonitoredSessiontf.train.SingularMonitoredSessiontf.train.Scaffoldtf.train.SessionCreatortf.train.ChiefSessionCreatortf.train.WorkerSessionCreator
Reading Summaries from Event Files
See Summaries and TensorBoard for an overview of summaries, event files, and visualization in TensorBoard.
tf.train.summary_iterator
Training Hooks
Hooks are tools that run in the process of training/evaluation of the model.
tf.train.SessionRunHooktf.train.SessionRunArgstf.train.SessionRunContexttf.train.SessionRunValuestf.train.LoggingTensorHooktf.train.StopAtStepHooktf.train.CheckpointSaverHooktf.train.NewCheckpointReadertf.train.StepCounterHooktf.train.NanLossDuringTrainingErrortf.train.NanTensorHooktf.train.SummarySaverHooktf.train.GlobalStepWaiterHooktf.train.FinalOpsHooktf.train.FeedFnHook
Training Utilities
tf.train.global_steptf.train.basic_train_looptf.train.get_global_steptf.train.assert_global_steptf.train.write_graph
