rbm.py 文件源码

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

项目:weather-modelling 作者: flipdazed 项目源码 文件源码
def sampleHgivenV(self, v0_sample):
        """ This function infers state of hidden units given visible units """
        # compute the activation of the hidden units given a sample of
        # the visibles
        pre_sigmoid_h1, h1_mean = self.propUp(v0_sample)
        # get a sample of the hiddens given their activation
        # Note that theano_rng.binomial returns a symbolic sample of dtype
        # int64 by default. If we want to keep our computations in floatX
        # for the GPU we need to specify to return the dtype floatX
        h1_sample = self.theano_rng.binomial(size=h1_mean.shape,
                                             n=1, p=h1_mean,
                                             dtype=theano.config.floatX)
        return [pre_sigmoid_h1, h1_mean, h1_sample]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号