Search code examples
tensorflowrecurrent-neural-networklosstensorflow-probabilityoverfitting-underfitting

RNN/GRU Increasing validation loss but decreasing mean absolute error


I am new to deep learning and I try to implement an RNN (with 2 GRU layers). At first, the network seems to do it's job quite fine. However, I am currently trying to understand the loss and accuracy curve. I attached the pictures below. The dark-blue line is the training set and the cyan line is the validation set. After 50 epochs the validation loss increases. My assumption is that this indicates overfitting. However, I am unsure why the validation mean absolute error still decreases. Do you maybe got an idea?

One idea I had in mind was that this could be caused by some big outliers in my dataset. Thus I already tried to clean it up. I also tried to scale it properly. I also added a few dropout layers for further regularization (rate=0.2). However these are just normal dropout layers because cudnn does not seem to support recurrent_dropout from tensorflow.

Remark: I am using the negative log-likelihood as loss function and a tensorflow probability distribution as the output dense layer.

Any hints what I should investigate? Thanks in advance

probabilistic

Edit: I also attached the non-probabilistic plot as recommended in the comment. Seems like here the mean-absolute-error behaves normal (does not improve all the time). non-probabilistic


Solution

  • What are the outputs of your model? It sounds pretty strange that you're using the negative log-likelihood (which basically "works" with distributions) as the loss function but the MAE as a metric, which is suited for deterministic continuous values.

    I don't know what is your task and perhaps this is meaningful in your specific case, but perhaps the strange behavior comes out from there.