def encode(self, input, sampling):
output = input
for layer in self.D_layers:
output = layer.encode(output)
# now compute mu and sigma
Mu = self.Mu_layer.encode(output)
if sampling:
shape = Mu.get_shape()
eps = tf.random_uniform(shape)
output = tf.select(eps - Mu <= 0, tf.ones(shape), tf.zeros(shape))
else:
output = Mu
return output, Mu
stochastic_layer.py 文件源码
python
阅读 18
收藏 0
点赞 0
评论 0
评论列表
文章目录