iancovert / Neural-GC

Granger causality discovery for neural networks.
MIT License
198 stars 51 forks source link

GC-est has all zero values #5

Closed manmeet3591 closed 3 years ago

manmeet3591 commented 3 years ago

I am trying to use Neural-GC for 8 variable time series having a length of 5840 each. I have tried both cmlp and clstm on the dataset. The training goes fine but the GC-est values are all zero. Can you help me with this. Following is the log at the start and end

Start ----------Iter = 100---------- Loss = 0.713952 Variable usage = 100.00% ----------Iter = 200---------- Loss = 0.697342 Variable usage = 100.00% ----------Iter = 300---------- Loss = 0.684179 Variable usage = 100.00%

End

Loss = 0.025705 Variable usage = 100.00% ----------Iter = 49800---------- Loss = 0.025695 Variable usage = 100.00% ----------Iter = 49900---------- Loss = 0.025685 Variable usage = 100.00% ----------Iter = 50000---------- Loss = 0.025675 Variable usage = 100.00%

iancovert commented 3 years ago

Hi Manmeet. The training log says Variable usage = 100.00%, and that's designed to check the entries of your GC matrix throughout training (see this line for the cMLP). 100% should mean that the GC entries are all ones (i.e., all features are being used), so are you sure they're all zeros? Have you tried plotting the GC matrix as well as just printing it?

manmeet3591 commented 3 years ago

Hi @iancovert Thanks for your prompt reply. Please find the code at https://tinyurl.com/yer6vncp where I have printed the GC matrix. At the time of training, the variable usage is 100% but when I extract the values by

GC_est = clstm.GC().cpu().data.numpy()

All the values are returned as 0

manmeet3591 commented 3 years ago

I was using learning rate as 5e-3 and this was happening. I changed to 5e-2 as you have provided in demo and all are now ones.

iancovert commented 3 years ago

Okay great - I'm glad to hear that fixed it, although I'm still not sure why this issue occurred with the smaller learning rate. Tuning the learning rate a little bit is a good idea, you may find that what we used isn't best for your dataset.

I'm going to close this issue for now, but let me know if any other issues come up.