Giter VIP home page Giter VIP logo

klcpd_code's Introduction

KL-CPD Pytorch Implementation

Code accompanying the ICLR 2019 paper Kernel Change-point Detection with Auxiliary Deep Generative Models.

Prerequisites

- Python (v2.7)
- PyTorch (v0.2.20)
- scikit-learn

see

  $ cat klcpd_py2.7_pt0.2.0_conda.txt

for an example of the detailed package dependencies configurations.

Main Usage

python klcpd.py [OPTIONS]
OPTIONS:
    --data_path DATA_PATH         data path to dataset.mat
    --trn_ratio TRN_RATIO         how much data used for training
    --val_ratio VAL_RATIO         how much data used for validation
    --gpu GPU                     gpu device id
    --cuda CUDA                   use gpu or not
    --random_seed RANDOM_SEED     random seed
    --wnd_dim WND_DIM             window size (past and future)
    --sub_dim SUB_DIM             dimension of subspace embedding
    --RNN_hid_dim RNN_HID_DIM     number of RNN hidden units
    --batch_size BATCH_SIZE       batch size for training
    --max_iter MAX_ITER           max iteration for pretraining RNN
    --optim OPTIM                 sgd|rmsprop|adam for optimization method
    --lr LR                       learning rate
    --weight_decay WEIGHT_DECAY   weight decay (L2 regularization)
    --momentum MOMENTUM           momentum for sgd
    --grad_clip GRAD_CLIP         gradient clipping for RNN (both netG and netD)
    --eval_freq EVAL_FREQ         evaluation frequency per generator update
    --CRITIC_ITERS CRITIC_ITERS   number of updates for critic per generator
    --weight_clip WEIGHT_CLIP     weight clipping for crtic
    --lambda_ae LAMBDA_AE         coefficient for the reconstruction loss
    --lambda_real LAMBDA_REAL     coefficient for the real MMD2 loss
    --save_path SAVE_PATH         path to save the final model
    --save_name SAVE_NAME         model/prediction names   

Quick Start on BeeDance dataset

For a quick start and experiment grid search, please execute run_klcpd.py. For an example on BeeDance dataset:

    $ python run_klcpd.py --dataroot ./data --dataset beedance --wnd_dim_list 25 --max_iter 2000 --batch_size 64 

More Info

This repository is by Wei-Cheng Chang, Chun-Liang Li, Yiming Yang, Barnabás Póczos, and contains the source code to reproduce the experiments in our paper Kernel Change-point Detection with Auxiliary Deep Generative Models. If you find this repository helpful in your publications, please consider citing our paper.

@article{chang2019kernel,
  title={Kernel change-point detection with auxiliary deep generative models},
  author={Chang, Wei-Cheng and Li, Chun-Liang and Yang, Yiming and P{\'o}czos, Barnab{\'a}s},
  journal={arXiv preprint arXiv:1901.06077},
  year={2019}
}

For any questions and comments, please send your email to [email protected]

klcpd_code's People

Contributors

octoberchang 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

Watchers

 avatar  avatar

klcpd_code's Issues

Getting errors in running the code with python3

While running the code in python3 environment, I am getting this error -- RuntimeError: Mismatch in shape: grad_output[0] has a shape of torch.Size([1]) and output[0] has a shape of torch.Size([]).

Any help in this regard will be highly appreciated. Thanks in advance.

How mmd2 loss calculated ?

Hi, thanks for great work.

While I am looking on KLCPD code, I wonder how mmd2 loss is calculated ? especially this part

Can you give me any reference or explanation how this code was derived ?

Thanks,

Best regards,
YJHong.

Test Results applicable to real-time CPD?

In your paper, you describe the application of your model to retrospective CPD which is typically synonymous with offline CPD, where the entire the dataset has been observed and the goal is to segment the time-series dataset accordingly. I assume this is the case given you did not compare some form of Time to Detection between the different methods.

My question then, if you have the entire dataset and are looking for CPs in some time series. Why would you limit yourself to only windows of the data at time? This is usually done in online (real-time) CPD because of necessity. Have you tried testing your method in an on-line fashion? (and compare it with CUSUM methods or other online CPD methods)

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.