【发布时间】:2017-10-24 09:09:47
【问题描述】:
我目前正在研究的神经网络接受稀疏张量作为输入。我正在从 TFRecord 读取我的数据,如下所示:
_, examples = tf.TFRecordReader(options=options).read_up_to(
filename_queue, num_records=batch_size)
features = tf.parse_example(examples, features={
'input_feat': tf.SparseFeature(index_key='input_feat_idx',
value_key='input_feat_values',
dtype=tf.int64,
size=SIZE_FEATURE)})
它的工作原理很吸引人,但我正在查看 tf.data API,它看起来更方便执行许多任务,我不知道如何像使用 tf.RecordReader 和 @987654325 那样读取 tf.SparseTensor 对象@。有什么想法吗?
【问题讨论】:
标签: tensorflow tensorflow-datasets