Skip to content Skip to sidebar Skip to footer

Same Output Of The Keras Model

I have a Keras model for predicting moves in the game. I have an input shape of (160,120 ,1). I have the following model with an output of 9 nodes: from keras.models import Sequent

Solution 1:

From what it appears in your code, and since you mentioned that the loss is decreasing very slowly, the best guess is that the input data (which I think are images) is not normalized and therefore this prevents a smooth gradient flow. Try normalizing them. One simple way of doing it is like this:

X = X.astype('float32') / 255.0test_x = test_x.astype('float32') / 255.0

Further, you may need to account for the class imbalance in the training data and counter it by using class_weights argument in fit method (look at the doc to find out how it can be used).

Post a Comment for "Same Output Of The Keras Model"