RVC
RVC

Reputation: 440

Tensorflow MNIST for Beginners

Why do I get different results each time I run the code? Granted, they are all around 92% test accuracy, but seeing as there is no randomness involved (weights are initialized to zero), and sampling the training data does not seem to be random, where could the randomness (resulting in different but close accuracy values) be coming from?

Or could there be something wrong with my installation? Am using an nvidia 960 gtx gpu, and installed TF from sources (version 0.12.head)

Upvotes: 0

Views: 190

Answers (1)

Peter Hawkins
Peter Hawkins

Reputation: 3211

If you look at the implementation of the next_batch function, you'll find it randomly shuffles the data set:

https://github.com/tensorflow/tensorflow/blob/master/tensorflow/contrib/learn/python/learn/datasets/mnist.py#L160

Try adding the argument shuffle=False to the next_batch call.

Hope that helps!

Upvotes: 2

Related Questions