def single_feature_file_reader(filename_queue, num_features):
""" Read and interpret data from a set of TFRecord files.
Args:
filename_queue: a queue of filenames to read through.
num_features: the depth of the features.
Returns:
A pair of tuples:
1. a context dictionary for the feature
2. the vessel movement features, tensor of dimension [width, num_features].
"""
reader = tf.TFRecordReader()
_, serialized_example = reader.read(filename_queue)
# The serialized example is converted back to actual values.
context_features, sequence_features = tf.parse_single_sequence_example(
serialized_example,
# Defaults are not specified since both keys are required.
context_features={'mmsi': tf.FixedLenFeature([], tf.int64), },
sequence_features={
'movement_features': tf.FixedLenSequenceFeature(
shape=(num_features, ), dtype=tf.float32)
})
return context_features, sequence_features
utility.py 文件源码
python
阅读 33
收藏 0
点赞 0
评论 0
评论列表
文章目录