GithubHelp home page GithubHelp logo

selftime's Introduction

Self-Supervised Time Series Representation Learning by Inter-Intra Relational Reasoning

This repository contains the official PyTorch implementation of:

Self-Supervised Time Series Representation Learning by Inter-Intra Relational Reasoning.

motivation

Abstract: Self-supervised learning achieves superior performance in many domains by extracting useful representations from the unlabeled data. However, most of traditional self-supervised methods mainly focus on exploring the inter-sample structure while less efforts have been concentrated on the underlying intra-temporal structure, which is important for time series data. In this paper, we present SelfTime: a general Self-supervised Time series representation learning framework, by exploring the inter-sample relation and intra-temporal relation of time series to learn the underlying structure feature on the unlabeled time series. Specifically, we first generate the inter-sample relation by sampling positive and negative samples of a given anchor sample, and intra-temporal relation by sampling time pieces from this anchor. Then, based on the sampled relation, a shared feature extraction backbone combined with two separate relation reasoning heads are employed to quantify the relationships of the sample pairs for inter-sample relation reasoning, and the relationships of the time piece pairs for intra-temporal relation reasoning, respectively. Finally, the useful representations of time series are extracted from the backbone under the supervision of relation reasoning heads. Experimental results on multiple real-world time series datasets for time series classification task demonstrate the effectiveness of the proposed method.

SelfTime

Requirements

  • Python 3.6 or 3.7
  • PyTorch version 1.4

Run Model Training and Evaluation

Self-supervised Pretraining

InterSample:

python train_ssl.py --dataset_name CricketX --model_name InterSample

IntraTemporal:

python train_ssl.py --dataset_name CricketX --model_name IntraTemporal

SelfTime:

python train_ssl.py --dataset_name CricketX --model_name SelfTime

Linear Evaluation

InterSample:

python test_linear.py --dataset_name CricketX --model_name InterSample

IntraTemporal:

python test_linear.py --dataset_name CricketX --model_name IntraTemporal

SelfTime:

python test_linear.py --dataset_name CricketX --model_name SelfTime

Supervised Training and Test

python train_test_supervised.py --dataset_name CricketX --model_name SupCE

Check Results

After runing model training and evaluation, the checkpoints of the trained model are saved in the local [ckpt] directory, the training logs are saved in the local [log] directory, and all experimental results are saved in the local [results] directory.

selftime's People

Contributors

haoyfan avatar

Watchers

James Cloos 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.