美文网首页
TensorFlow Datasets and Estimato

TensorFlow Datasets and Estimato

作者: satyrs_sh | 来源:发表于2017-12-03 23:34 被阅读0次
    • 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)
    

    相关文章

      网友评论

          本文标题:TensorFlow Datasets and Estimato

          本文链接:https://www.haomeiwen.com/subject/sfwzbxtx.html