mnist.py 文件源码

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

项目:vae-npvc 作者: JeremyCCHsu 项目源码 文件源码
def mnist_batcher_in_tanh_vector(
    batch_size,
    capacity=256,
    min_after_dequeue=128,
    ):
    (x, y), (_, _) = keras.datasets.mnist.load_data()
    x = tf.constant(x)
    x = tf.cast(x, tf.float32)
    x = keras.layers.Flatten()(x) / 127.5 - 1.
    y = tf.cast(y, tf.int64)

    return tf.train.shuffle_batch(
        [x, y],
        batch_size=batch_size,
        capacity=capacity,
        min_after_dequeue=min_after_dequeue,
        enqueue_many=True
    )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号