FlorentF9 / DeepTemporalClustering

:chart_with_upwards_trend: Keras implementation of the Deep Temporal Clustering (DTC) model
MIT License
219 stars 58 forks source link

Nan: Predicted Value #13

Closed BEbillionaireUSD closed 3 years ago

BEbillionaireUSD commented 3 years ago

Hi, I got all nan predicted values when running your code. In DTC.fit, everything goes well when calculating p and q for the first time just after "init_cluster_weights". But when it reached "model.fit(X_train, [X_train, p]" for the first time and then got predicted value in the next iteration, all predicted values turned to be nan.

I have tried several ways to modify it, including: enlarge batchsize reduce learning rate of Adam grad clip redefine the KL loss function to avoid log(0)

I am sure there is no nan or inf in the input data. Could you please help me to solve the problem?

Looking forward to your reply and HAPPY CHRISTMAS HOLIDAY!

FlorentF9 commented 3 years ago

Hi,

Thanks, and best wishes for this new year! (including making this code work) First, are you using one of the UCR benchmark data sets, or your own data set?

BEbillionaireUSD commented 3 years ago

I only use my own data set. The strange thing is that I happened to use another computer and the problem disappeared.

I think there may be some exclusive bugs in the tensorflow. Because I didn't change any codes, the only difference between these two computers is that they have different versions of tensorflow.

Thanks for your reply!