kdgutier / esrnn_torch

MIT License
156 stars 44 forks source link

Traning and testing losses return 'nan' during training #5

Closed DataExMachina closed 4 years ago

DataExMachina commented 4 years ago

Hi all,

First of all thank you for your amazing job on ES-RNN pytorch implementation. I have been able to run the M4 scripts, but I encountered troubles trying to run ESRNN architecture on an another data source.

I am trying to apply this model on the M5 competition. The input is the following tables: image

I define the model as following (taking some parameters from the initial config dict) and use previously defined tables to train it: image

But I observe that the network does not seem to learn, because of 'nan' returned during training. Is there something I missed ?

cchallu commented 4 years ago

Hi,

Thanks for using our implementation. For what I can see in the data there are multiple zeros in the target variable. The model will return nan losses if the target variable of any serie has zero in the first ds (since the model normalizes the series by previous values). Can you try adding 1 (or any scalar) to all the target variable for all ds? You can then substract the scalar to the predictions.

DataExMachina commented 4 years ago

Hi !

Thanks a lot, it works !