autoencoder.py 文件源码

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

项目:TensorFlow-World 作者: astorfi 项目源码 文件源码
def resize_batch(imgs):
    # A function to resize a batch of MNIST images to (32, 32)
    # Args:
    #   imgs: a numpy array of size [batch_size, 28 X 28].
    # Returns:
    #   a numpy array of size [batch_size, 32, 32].
    imgs = imgs.reshape((-1, 28, 28, 1))
    resized_imgs = np.zeros((imgs.shape[0], 32, 32, 1))
    for i in range(imgs.shape[0]):
        resized_imgs[i, ..., 0] = transform.resize(imgs[i, ..., 0], (32, 32))
    return resized_imgs
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号