Configuration for the "train" part for the
TrainSpec determines the input data for the training, as well as the duration. Optional hooks run at various stages of training.
Alias for field number 2
Alias for field number 0
Alias for field number 1
@staticmethod __new__( cls, input_fn, max_steps=None, hooks=None )
Creates a validated
input_fn: A function that provides input data for training as minibatches. See Premade Estimators for more information. The function should construct and return one of the following:
Datasetobject must be a tuple (features, labels) with same constraints as below.
Tensoror a dictionary of string feature name to
Tensorand labels is a
Tensoror a dictionary of string label name to
max_steps: Int. Positive number of total steps for which to train model. If
None, train forever. The training
input_fn is not expected to generate
StopIteration exceptions. See the
train_and_evaluate stop condition section for details.
hooks: Iterable of
tf.train.SessionRunHookobjects to run on all workers (including chief) during training.
ValueError: If any of the input arguments is invalid.
TypeError: If any of the arguments is not of the expected type.
© 2018 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.