vae.py 文件源码

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

项目:TensorFlow-ADGM 作者: dancsalo 项目源码 文件源码
def multinomial_stochastic(self, input_tensor, num_maps, scope):
        """
        :param inputs_list: list of Tensors to be added and input into the block
        :return: random variable single draw, mean, and intermediate representation
        """
        with tf.variable_scope(scope):
            input_tensor = tf.expand_dims(tf.expand_dims(input_tensor, 1), 1) if len(input_tensor.get_shape()) != 4 \
                else input_tensor
            intermediate = slim.conv2d(input_tensor, self._hidden_size, [1, 1], weights_initializer=self._initializer,
                                  scope='conv1')
            pi = slim.conv2d(intermediate, num_maps, [1, 1], weights_initializer=self._initializer,
                                 activation_fn=None, scope='mean')
            rv_single_draw = tf.nn.softmax(pi)
        self.split_labeled_unlabeled(pi, '{}_pi'.format(scope))
        self.split_labeled_unlabeled(rv_single_draw, '{}_sample'.format(scope))
        return rv_single_draw
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号