https://github.com/googleinterns/local_global_ts_representation
https://github.com/googleinterns/local_global_ts_representation
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/googleinterns/local_global_ts_representation
- Owner: googleinterns
- License: apache-2.0
- Created: 2021-11-22T23:00:40.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-01-27T18:51:34.000Z (over 4 years ago)
- Last Synced: 2023-08-05T07:44:42.396Z (almost 3 years ago)
- Language: Python
- Size: 69.3 KB
- Stars: 16
- Watchers: 1
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: docs/code-of-conduct.md
Awesome Lists containing this project
README
**This is not an officially supported Google product.**
# Learning Decoupled Local and Global Representations for Time Series

### Training the GLR model
You can use the main script to train the local and global representation learning model for the datasets presented in the paper. This script will train all the model components, and plot the distribution of the local and global representation for the population.
```
python -m main --data [DATASET_NAME] --lamda [REGULARIZATION_WEIGHT] --train
```
#### In order to train the GLR model on your own dataset, follow the steps below:
1. Create your encoder and decoder architectures and instantiate a GLR model for your dataset
```
glr_model = GLR(global_encoder, local_encoder, decoder, time_length, data_dim, window_size, kernel, beta, lamda)
```
3. Create your own data loader function and dataset object (Make sure it includes the sample, mask, and the sample length)
4. Train the model!
```
glr_model.train(trainset, validset, [NAME OF DATASET], lr, n_epochs)
```
### Training baseline models
In order to replicate the baseline experiments, train the baseline models (VAE or GPVAE) using the following script
```
python -m baselines.vae --data [DATASET_NAME] --rep_size [Z_SIZE] --train
python -m baselines.gpvae --data [DATASET_NAME] --rep_size [Z_SIZE] --train
```
### Running the evaluation tests
All codes for the evaluation experiments can be found under the evaluations directory. Make sure to specify the baseline model in the code when running each experiment.