-
TextLineDataset
从text中读取lines
- Returns:
A list of Tensor
objects. Has the same type as record_defaults
.
- 默认情况,
TextLineDataset
yields every line of each file
#filter以#开头的注释部分
dataset = dataset.flat_map(
lambda filename: (
tf.data.TextLineDataset(filename)
.skip(1)
.filter(lambda line: tf.not_equal(tf.substr(line, 0, 1), "#"))))
-
TFRecordDataset
TFRecord中读取
-
FixedLengthRecordDataset
二进制文件读取固定大小的record
Dataset
-
tf.decode_csv
- Returns:
A list of Tensor
objects. Has the same type as record_defaults
.
Each tensor will have the same shape as records.
Estimator.jpg
-
input_fn
provides the estimator with input data
feature_columns = [tf.feature_column.numeric_column(k) for k in feature_names] #features_names为特征名称的list
classifier = tf.estimator.DNNClassifier(
feature_columns=feature_columns, # The input features to our model
hidden_units=[10, 10], # 2层 10个neurons
n_classes=3,
model_dir=PATH)
网友评论