the_redcar
the_redcar

Reputation: 127

Tensorflow Neural Network MSE large discrepancies

I am a beginner at Tensorflow Neural Networks, and I am following an online guide to learn how to train Sequential Neural Network models. When computing the mean squared error of my test data, I get very different results every time I compile the model. Sometimes I get a MSE of about 27 to 28, and other times I get a very strange MSE of ~20,000. I am not changing any variables every time I recompile my model. Why is this happening? Thanks for responding.

Upvotes: 2

Views: 231

Answers (1)

Richard X
Richard X

Reputation: 1134

If you are not loading pretrained weights, your model will load with different weights every time you recompile your model, thus giving you random values on inference before training. To ensure that weights are the same for each run, set a random seed in tf.random.set_seed(SEED).

Upvotes: 1

Related Questions