This is the official code "Noise Matters: Cross Contrastive Learning for Flink Anomaly Detection"
- We use a cross contrastive method to detect the anomaly.
- We use a prior information to alleviate the noise inside training dataset
|-- data_factory
| -- data_loader.py
|-- main.py
|-- model
| |-- PointAttention.py # model file
| |-- RevIN.py
| |-- attend.py
|-- readme.md
|-- requirements.txt
|-- scripts
| |-- ....sh # scripts
|-- solver.py
`-- utils
|-- logger.py
-- utils.py
The code is well-tested on python>=3.10
This code base using accelerate
for multi GPU training, please setup your local accelerate env following the instruction.
After that,
-
download the dataset from google drive and rename the folder to
dataset
-
pip install -r requirements.txt
-
train and evaluate using the script under the
scripts
(Due to differences in GPUs number, machines, parameters, etc., there may be slight variations in the experimental results.) folder.# e.g., # train accelerate launch main.py --anormly_ratio 1 --num_epochs 3 --batch_size 256 --mode train --dataset PSM --data_path PSM --input_c 25 --output_c 25 --loss_fuc MSE --win_size 35 # test accelerate launch main.py --anormly_ratio 1 --num_epochs 3 --batch_size 256 --mode test --dataset PSM --data_path PSM --input_c 25 --output_c 25 --loss_fuc MSE --win_size 35
If you find the code useful, please cite our paper.