4

I ran the same code (with the same data) on CPU first using keras 1.2.0 and then keras 2.0.3 in both codes keras is with TensorFlow backend and also I used sklearn for model selection, plus pandas to read data.

I was surprised when I got the MSE(Mean squared error) of 42 using keras 2.0.3 and 21 using keras 1.2.0. Can someone pls explain to me why this is happening? Why I am getting more error using keras 2? Thanks

PS. This result is after editing the code to keras 2 standard. for example in Dense I change keras 1 code to keras 2 standard.

TRiba
  • 61
  • 6

3 Answers3

1

Is really the MSE increased, or is it the loss? If you use regularizers, this may not be the same (even when using mean_squared_error as loss function), since the regularizer gives a penalty to the loss.

I think earlier versions of keras just gave you the MSE, now they show the loss. This could explain your observation.

ascripter
  • 5,665
  • 12
  • 45
  • 68
0

Probably some default values that have changed from Keras 1.2. You should check the default values for you 1.2 code, and set the same value for your new code.

dahoiv
  • 85
  • 1
  • 5
0

Keras 1 vs 2 has a lot of changes. Specifically the functions have many altered keyword arguments, your Keras 1 code is pretty worthless if your trying to run it after updating to Keras 2. Either downgrade back to version 1.2.0 or I would suggest going here and editing your code accordingly.

Fury
  • 456
  • 6
  • 12