Code Monkey home page Code Monkey logo

anomaly_transformer_pytorch's Introduction

Anomaly Transformer in PyTorch

This is an implementation of Anomaly Transformer: Time Series Anomaly Detection with Association Discrepancy. This paper has been accepted as a Spotlight Paper at ICLR 2022.

Repository currently a work in progress.

Usage

Requirements

Install dependences into a virtualenv:

$ python -m venv env
$ source env/bin/activate
(env) $ pip install -r requirements.txt

Written with python version 3.8.11

Data and Configuration

Custom datasets can be placed in the data/ dir. Edits should be made to the conf/data/default.yaml file to reflect the correct properties of the data. All other configuration hyperparameters can be set in the hydra configs.

Train

Once properly configured, a model can be trained via python train.py.

Citations

@misc{xu2021anomaly,
      title={Anomaly Transformer: Time Series Anomaly Detection with Association Discrepancy},
      author={Jiehui Xu and Haixu Wu and Jianmin Wang and Mingsheng Long},
      year={2021},
      eprint={2110.02642},
      archivePrefix={arXiv},
      primaryClass={cs.LG}
}

anomaly_transformer_pytorch's People

Contributors

spencerbraun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

anomaly_transformer_pytorch's Issues

Hi, I have a question !

Your research is very impressive and wonderful. However, I have one question while reading the paper.

in this paper, For the maximize phase, we optimize the series-association to enlarge the association discrepancy. This process forces the series-association to pay more attention to the non-adjacent horizon.

Maximize phases seem to focus more on series-association on adjacent horizon, but why is this non-adjacent horizon?

In my opinion, if the sigma of the prior association is much less than 1, the series association will only look at more adjacent areas.

Thank you
image

Dataprocess

How should I process my data?The function "get_data" has not been defined.

Incorrect prior_association() ?

It seems the method prior_association() can not back propagate gradient to train Ws, or maybe I misunderstood?

def prior_association(self):
p = torch.from_numpy(
np.abs(np.indices((self.N, self.N))[0] - np.indices((self.N, self.N))[1])
)
gaussian = torch.normal(p.float(), self.sigma[:, 0].abs())

according to paper, is this the right way?
gaussian = 1 / math.sqrt(2 * math.pi) / self.sigma * torch.exp(- 0.5 * (p / self.sigma).pow(2))

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.