I am newbie to keras.
I ran it on a dataset where my objective was to reduce the logloss. For every epoch it is giving me the same loss value. I am confused whether i am on the right track or not.
For example:
Epoch 1/5
91456/91456 [==============================] - 142s - loss: 3.8019 - val_loss: 3.8278
Epoch 2/5
91456/91456 [==============================] - 139s - loss: 3.8019 - val_loss: 3.8278
Epoch 3/5
91456/91456 [==============================] - 143s - loss: 3.8019 - val_loss: 3.8278
Epoch 4/5
91456/91456 [==============================] - 142s - loss: 3.8019 - val_loss: 3.8278
Epoch 5/5
91456/91456 [==============================] - 142s - loss: 3.8019 - val_loss: 3.8278
Here 3.8019 is same in every epoch. It is supposed to be less.
I ran into this issue as well. After much deliberation, I figured out that it was my activation function on my output layer.
I had this model to predict a binary outcome:
model = Sequential()
model.add(Dense(16,input_shape=(8,),activation='relu'))
model.add(Dense(32,activation='relu'))
model.add(Dense(32,activation='relu'))
model.add(Dense(1, activation='softmax'))
and I needed this for binary cross entropy
model = Sequential()
model.add(Dense(16,input_shape=(8,),activation='relu'))
model.add(Dense(32,activation='relu'))
model.add(Dense(32,activation='relu'))
model.add(Dense(1, activation='sigmoid'))
I would look towards the problem you are trying to solve and the output needed to ensure that your activation functions are what they need to be.
Try decreasing your learning rate to 0.0001 and use Adam. What is your learning rate?
It's actually not clear to see if its the problem of learning rate or model complexity, could you explain a bit further with these instructions:
Since you're new to deep learning, these advices are enough to check if there's a problem on your model. Can you please check them and reply?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With