d-ailin / GDN

Implementation code for the paper "Graph Neural Network-Based Anomaly Detection in Multivariate Time Series" (AAAI 2021)
MIT License
490 stars 142 forks source link

Figure 2: t-SNE plot #99

Closed sozgny closed 6 months ago

sozgny commented 6 months ago

Hello again! Could you provide us some information about how can we plot t-SNE of sensor embeddings of trained model? I tried to write a function which takes the trained model & X_train as input, and then find the corresponding sensor embeddings on X_train set within indexes using node_num of X_train. But the function doesnt work, how I can obtain the sensor embeddings of trained model via a function for example obtain_node_embeddings(model, X_train) ?

sozgny commented 6 months ago

Specifically, I couldn't find the 7 classes of sensors in WADI that you mentioned in the article. My t-SNE plot has only one color and can not identify the clusters. Could you provide me the class labels of sensors?

d-ailin commented 6 months ago

Hi, the embeddings can be retrieved from https://github.com/d-ailin/GDN/blob/9853899da860682669a134e4af315d036aab4eca/models/GDN.py#L95 after training the model. The sequence of the embeddings is the same as in the sequence of sensor names provided in the list.txt.