Skip to content

Domain Adaptation for Time Series Under Feature and Label Shifts

License

Notifications You must be signed in to change notification settings

ConnieC14/Raincoat

Repository files navigation

Requirmenets:

  • Python3
  • Pytorch==1.7
  • Numpy==1.20.1
  • scikit-learn==0.24.1
  • Pandas==1.2.4
  • skorch==0.10.0
  • openpyxl==3.0.7

Datasets

Loading and Preparing Benchmark Datasets

Create a folder and download the pre-processed versions of the datasets WISDM, HAR, HHAR, Boiler, and Sleep-EDF.

To add new dataset (e.g., NewData), it should be placed in a folder named: NewData in the datasets directory.

Since "NewData" has several domains, each domain should be split into train/test splits with naming style as "train_x.pt" and "test_x.pt".

The structure of data files should in dictionary form as follows: train.pt = {"samples": data, "labels: labels}, and similarly for test.pt.

Configurations

Next, you have to add a class with the name NewData in the configs/data_model_configs.py file. You can find similar classes for existing datasets as guidelines. Also, you have to specify the cross-domain scenarios in self.scenarios variable.

Last, you have to add another class with the name NewData in the configs/hparams.py file to specify the training parameters.

Closed-Set Domain Adaptation Algorithms

Baselines

Universal Domain Adaptation Algorithms

Existing Algorithms

RAINCOAT

Model

Our main model architecture can be found here.

Algorithm

Our training algorithm can be found here.

Training procedure

The experiments are organised in a hierarchical way such that:

  • Several experiments are collected under one directory assigned by --experiment_description.
  • Each experiment could have different trials, each is specified by --run_description.
  • For example, if we want to experiment different UDA methods with CNN backbone, we can assign --experiment_description CNN_backnones --run_description DANN and --experiment_description CNN_backnones --run_description DDC and so on.

Training a model

To train a model:

python main.py  --experiment_description exp1  \
                --run_description run_1 \
                --da_method DANN \
                --dataset HHAR \
                --backbone CNN \
                --num_runs 5 \

About

Domain Adaptation for Time Series Under Feature and Label Shifts

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 97.7%
  • Shell 2.3%