premade estimators

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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值