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())
评论列表
文章目录