distribute_cake.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:deepcake 作者: ericyue 项目源码 文件源码
def read_and_decode(filename_queue):
  reader = tf.TFRecordReader()
  _, serialized_example = reader.read(filename_queue)
  features = tf.parse_single_example(
      serialized_example,
      features={
          "label": tf.FixedLenFeature([], tf.float32),
          "categorical_features": tf.FixedLenFeature([CATEGORICAL_FEATURES_SIZE], tf.string),
          "continuous_features": tf.FixedLenFeature([CONTINUOUS_FEATURES_SIZE], tf.float32),
      })
  label = features["label"]
  continuous_features = features["continuous_features"]
  categorical_features = tf.cast(tf.string_to_hash_bucket(features["categorical_features"], BUCKET_SIZE), tf.float32)
  return label, tf.concat(0, [continuous_features, categorical_features])


# Read serialized examples from filename queue
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号