PyTorch implementation of MTAD-GAT (Multivariate Time-Series Anomaly Detection via Graph Attention Networks) by Zhao et. al (2020, https://arxiv.org/abs/2009.02040).
This proposed pull request solves two issues that come up when running the MTAD-GAT PyTorch model.
[1] During prediction, a series of PerformanceWarning messages spams the console. This is due to the fact that in the prediction.py file, an empty dataframe is initialized and is then populated with columns and values within a for loop. This is considered a bad practice, hence the warnings that spam the console. Initializing a dictionary object and then casting it into a DataFrame solves the problem.
[2] More importantly, during prediction, the wrong arguments are parsed in the predict.py file. More specifically, all model parameters are parsed from the args dictionary instead of the model_args dictionary. This means one of two things: either the user must specify all model parameters both during training and prediction through the console, or if they do not specify them during prediction, then an error does not occur if and only if the model has been trained with the default parameters. Replacing args with model_args in the specified region of the code solves this problem.
This proposed pull request solves two issues that come up when running the MTAD-GAT PyTorch model.
[1] During prediction, a series of
PerformanceWarning
messages spams the console. This is due to the fact that in theprediction.py
file, an empty dataframe is initialized and is then populated with columns and values within a for loop. This is considered a bad practice, hence the warnings that spam the console. Initializing a dictionary object and then casting it into a DataFrame solves the problem.[2] More importantly, during prediction, the wrong arguments are parsed in the
predict.py
file. More specifically, all model parameters are parsed from theargs
dictionary instead of themodel_args
dictionary. This means one of two things: either the user must specify all model parameters both during training and prediction through the console, or if they do not specify them during prediction, then an error does not occur if and only if the model has been trained with the default parameters. Replacingargs
withmodel_args
in the specified region of the code solves this problem.