estimators, which represent a complete model. the estimator API provides methods to train the model, to judge the model's accuracy, and to generate predictions
datasets, which build a data input pipeline. the Dataset API has methods to load and manipulate data, and feed it into your model. the Dataset API meshes well with the estimators API
an estimator is tensorflow's high-level representation of a complete model. it handles the details of initialization, logging, saving and restoring, and many other features so you can concentrate on your model
an estimator is any class derived from tf.estimator.Estimator
an input function is a function that returns a tf.data.Dataset object which outputs the following two-element tuple:
features-a python dictionary in which:
each key is the name of a feature
each value is an array containing all of that feature's values
label-an array containing the values of the label for every example
###
def input_evaluation_set():
features = {'SepalLength': np.array([6.4, 5.0]),
'SepalWidth': np.array([2.8, 2.3]),
'PetalLength': np.array([5.6, 3.3]),
'PetalWidth': np.array([2.2, 1.0])
}
labels = np.array([2, 1])
return features, labels
you input function may generate the features dictionary and label list any way you like
Dataset-base class containing methods to create and transform datasets. also allows you to initialize a dataset from data in memory, or from a python generator
TextLineDataset-reads lines from text files
TFRecordDataset-reads records from TFRecord files
FixedLengthRecordDataset-reads fixed size records from binary files
Iterator-provides a way to access one data set element at a time
a feature column is an object describing how the model should use raw input data from the features dictonary. when you build an estimator model, you pass it a list of feature columns that describes each of the features you want the model to use. the tf.feature_column module provides many options for representing data to the model
datasets, which build a data input pipeline. the Dataset API has methods to load and manipulate data, and feed it into your model. the Dataset API meshes well with the estimators API
an estimator is tensorflow's high-level representation of a complete model. it handles the details of initialization, logging, saving and restoring, and many other features so you can concentrate on your model
an estimator is any class derived from tf.estimator.Estimator
an input function is a function that returns a tf.data.Dataset object which outputs the following two-element tuple:
features-a python dictionary in which:
each key is the name of a feature
each value is an array containing all of that feature's values
label-an array containing the values of the label for every example
###
def input_evaluation_set():
features = {'SepalLength': np.array([6.4, 5.0]),
'SepalWidth': np.array([2.8, 2.3]),
'PetalLength': np.array([5.6, 3.3]),
'PetalWidth': np.array([2.2, 1.0])
}
labels = np.array([2, 1])
return features, labels
you input function may generate the features dictionary and label list any way you like
Dataset-base class containing methods to create and transform datasets. also allows you to initialize a dataset from data in memory, or from a python generator
TextLineDataset-reads lines from text files
TFRecordDataset-reads records from TFRecord files
FixedLengthRecordDataset-reads fixed size records from binary files
Iterator-provides a way to access one data set element at a time
a feature column is an object describing how the model should use raw input data from the features dictonary. when you build an estimator model, you pass it a list of feature columns that describes each of the features you want the model to use. the tf.feature_column module provides many options for representing data to the model