LiDan456 / MAD-GANs

Applied generative adversarial networks (GANs) to do anomaly detection for time series data
519 stars 163 forks source link

NaN issue in DR_discriminator.py file #2

Closed Santhanalakshmimano closed 5 years ago

Santhanalakshmimano commented 5 years ago

While testing KDD dataset, in DR_discriminator.py file I am getting nan values for reconstruction error, and G_samples are also nan.. Do anybody knows why this happens ?

sathyapatel commented 5 years ago

Hi Santhanalakshmi, I am facing the same issue on kdd99 test data.. Heuristic sigma is 0 and reconstruction error is NAN..Please let me know, if you solved this issue

Santhanalakshmimano commented 5 years ago

Hi Sathyapatel, The issue is due to the distance we calculate. Just change the line distances = np.sqrt(X_sqnorms.reshape(-1, 1) - 2 * XY + Y_sqnorms.reshape(1, -1)) to distances = np.sqrt(((X[:, None] - Y[:, :, None]) ** 2).sum(0))

Adapter525 commented 2 years ago

why you change edistances in this way? thank you

Adapter525 commented 2 years ago

@Santhanalakshmimano why you change edistances in this way? thank you