ae.py 文件源码

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

项目:structured-output-ae 作者: sbelharbi 项目源码 文件源码
def sample_scan(self, x, sigma, n_steps, samples):
        # Enable on-the-fly graph computations
        #  theano.config.compute_test_value = "raise"
        in_val = T.fmatrix("input_values")
        # in_val.tag.test_value = np.asarray(
        #    np.random.rand(1, 784), dtype=theano.config.floatX)
        s_sigma = T.fscalr("sigma_values")
        # s_sigma = np.asarray(
        #    np.random.rand(1), dtype=theano.config.floatX)
        mode = "FAST_RUN"
        values, updates = theano.scan(fn=self.sample_one_step,
                                      outputs_info=in_val,
                                      non_sequences=s_sigma,
                                      n_steps=n_steps,
                                      mode=mode)
        ae_sampler = theano.function(inputs=[in_val, s_sigma],
                                     outputs=values[-1],
                                     updates=updates)
        samples = ae_sampler(x, sigma)
        return samples
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号