likelihood_estimation_parzen.py 文件源码

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

项目:GSN 作者: peteykun 项目源码 文件源码
def main(sigma, sample_path='samples.npy'):

    # provide a .npy file where 10k generated samples are saved. 
    filename = sample_path

    print 'loading samples from %s'%filename

    mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
    test_X, test_Y = mnist.test.next_batch(mnist.test.num_examples)
    samples = numpy.load(filename)

    test_ll = numpy_parzen(test_X, samples, sigma)

    print "Mean Log-Likelihood of test set = %.5f" % numpy.mean(test_ll)
    print "Std of Mean Log-Likelihood of test set = %.5f" % (numpy.std(test_ll) / 100)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号