Getting worse result using keraf 2 than keras 1

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

I was surprised when I got MSE (mean square error) of 42 using keras 2.0.3 and 21 using keras 1.2.0. Can anyone explain to me why this is happening? Why am I getting more errors when using keras 2? Thanks to

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

+3


source to share


3 answers


Maybe some defaults that have changed since Keras 1.2. You should check the default values ​​for code 1.2 and set the same value for your new code.



0


source


Keras 1 vs 2 has a lot of changes. Functions in particular have a lot of keyword arguments changed, your Keras 1 code is pretty useless if you're trying to run it after upgrading to Keras 2. Either go to version 1.2.0 or I suggest going here and edit your code accordingly.



0


source


Has MSE really increased, or is it a loss? If you are using regularizers, this may not be the same (even when used mean_squared_error

as a loss function) as the regularizer gives a penalty for the loss .

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

0


source







All Articles