Code Monkey home page Code Monkey logo

rita's Introduction

RITA

This Repo contains code and data for "RITA: Group Attention is All You Need for Timeseries Analytics."

overview_0

overview_1

Installation

In stall the required packages through pip install:

pip install -r requirements.txt

Data

The zip file of preprocessed dataset can be acess at https://storage.googleapis.com/rita_resources/rita_dataset.tar.gz. Please download the zip file and put it under the directory rita/. Then perform the following commands to unzip dataset files.

tar -zxvf rita_dataset.tar.gz

Model Running

Go to the under directory code:

cd code/

The running command is as following:

python run.py --dataset DATASET --mode MODE --data
_size LABLE_SIZE [--pretrained_path PRETRAINED_PATH]

DATASET describes the dataset, which should be among [wisdm,rwhar,hhar,ecg]. MODE describes the running mode, which should be among [pretrain,train,finetune]. LABLE_SIZE describes the size of labels used in training stage, which should be among [full,few]. PRETRAINED_PATH is requried when MODE=finetune; it indicates the path to pretrained checkpoint to start with.

Full-label Training

To perform full-label training, set MODE to train and LABLE_SIZE to full. For example, the command of full-label training on dataset WISDM is:

python run.py --dataset wisdm --mode train --data_size full

Pretrain & Few-label Finetuning

To perform self-superviesed pretraining, set MODE to pretrain. For example, the command of full-label training on dataset WISDM is:

python run.py --dataset wisdm --mode pretrain --data_size full

The pretrained checkpoints are stored in directory rita/code/checkpoints. After pretraining, the checkpoints can be copied and saved for further finetuning.

To perform few-label finetuning, set MODE to finetune and set PRETRAINED_PATH to the pretrained checkpoint's path, which is either obtained by performing pretraining as described above or downloading the pretrained checkpoints at https://storage.googleapis.com/rita_resources/rita_pretrained.tar.gz. For example, the command of few-label finetuning on dataset WISDM is:

python run.py --dataset wisdm --mode finetune --data_size few --pretrained_path WISDM_PRETRAINED_PATH

rita's People

Contributors

ljmzlh 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.