uniform_encoder.py 文件源码

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

项目:HyperGAN 作者: 255BITS 项目源码 文件源码
def gaussian(config, gan, net):
    z_dim = int(config.z)
    net = (net + 1) / 2

    za = tf.slice(net, [0,0], [gan.batch_size(), z_dim//2])
    zb = tf.slice(net, [0,z_dim//2], [gan.batch_size(), z_dim//2])

    pi = np.pi
    ra = tf.sqrt(-2 * tf.log(za+TINY))*tf.cos(2*pi*zb)
    rb = tf.sqrt(-2 * tf.log(za+TINY))*tf.sin(2*pi*zb)

    return tf.reshape(tf.concat(axis=1, values=[ra, rb]), net.get_shape())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号