wxdang / MSCRED

tensorflow implement the paper A Deep Neural Network for Unsupervised Anomaly Detection and Diagnosis in Multivariate Time Series Data
60 stars 28 forks source link

num_anom calculation may be wrong? #3

Open CLNET-pixel opened 4 years ago

CLNET-pixel commented 4 years ago

I suppose your code forget to add [0] into the np.where. "num_anom = len(np.where(error > util.threhold)) " ,this will lead to all valid_anomaly_score being 2. Maybe you should modify it with num_anom = len(np.where(error > util.threhold)[0])

sangramkapre commented 4 years ago

I encountered the same issue. It should be "num_anom = len(np.where(error > util.threhold)[0])" like you said or "num_anom = (np.sum(error > util.threhold))" to count the points where we have reconstruction error larger than the threshold.