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)
评论列表
文章目录