Giter VIP home page Giter VIP logo

tdsrl's Introduction

TDSRL: Time Series Dual Self-Supervised Representation Learning for Anomaly Detection from Different Perspectives

There is the code of our paper

Dataset

We adopt three widely-used benchmarks in time series anomaly task to evaluate our network. We have placed the pre-processed datasets in folder dataset/pocessed.

The NeurIPS-TS Benchmark mentioned in our paper can be found at:

https://github.com/datamllab/tods/tree/benchmark/benchmark/synthetic

Get Start

Install Python >= 3.8, PyTorch >= 1.9 with CUDA.

pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
pip install -r requirements.txt

Run the codes

You can train the network by running the file train.py, for example:

python train.py --dataset=SWaT --TA_replacing=0.5 --num_FD_perturbation_positions=15

After training, you will get the model parameters in the file logs, which is the default path.

If you need to evaluate the network, please select your dataset, trained model and corresponding parameters. Then run the file evaluate.py, for example:

python evaluate.py --dataset=SWaT --model_dict=logs\Example_SWaT\Example_SWaT_model.pt --parameters_dict=logs\Example_SWaT\state\Example_SWaT.pt --window_sliding=16 

If you want to save the evaluations results to the path and file you specify, please run as following:

python evaluate.py --matrics_outfile=path\file_name.txt --dataset=SWaT --model_dict=logs\Example_SWaT\Example_SWaT_model.pt --parameters_dict=logs\Example_SWaT\state\Example_SWaT.pt

Reference

We appreciate the following github repos a lot for their valuable code:

https://github.com/Jhryu30/AnomalyBERT

tdsrl's People

Contributors

ys-dai avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.