This repository contains the code for my MSc thesis research at UofT and EPFL, and for the 2022 ICML SCIS Workshop paper "Understanding Generalization and Robustess of Learned Representations of Chaotic Dynamical Systems".
ValiDyna is the name given to this evaluation framework that can assess the quality of learned representations of dynamical systems. It allows to write many kinds of experiments in a multi-task setting, and includes the multi-task extension of GRU, LSTM, Transformer and N-BEATS.
- (Pre-requisite) Install
anaconda
orminiconda
. - Clone this git repository and step into it
- Run the command
conda env create -f environment.yml
- this will create an environment named
chaos
- you can change the environment name in the
environment.yml
file before running the command
- this will create an environment named
- (For Linux), run the command
export PYTHONPATH="${PYTHONPATH}:${pwd}/validyna"
to add validyna to the set of libraries that can be imported
validyna
: the source code for the projectmain.py
: the entry-point to the framework, the only part of the code to be runmodels
multitask_models.py
: the adaptation of N-BEATS, LSTM, GRU and Transformer to a multi-task settingtask_modules.py
: Pytorch-Lightning modules that encapsulate specific tasks with its own training objective and metricsnbeats.py
: our custom implementation of the N-BEATS architecture
metrics.py
: custom metricsregistry.py
: contains all usable model architectures, tasks and metrics, and can be easily extendeddata.py
: a helper file with data processing and loading / saving utilitiesplot.py
: a helper file with plotting functions
experiment_configs
feature_freeze
: the configs for the experiment "Multi-Task Transfer-Learning" in the paperfew_shot
: the configs for the experiment "One-shot Learning" in the paperprober
: the configs for a new experiment not appearing in the paperdefault.py
: the default configuration used across experiments
scripts
compute_attractor_stats.py
: a script that counts the number of attractors per space dimensiongenerate_data.py
: a configurable script to generate synthetic chaotic data
notebooks
Plot Results.ipynb
: notebook downloading metrics from wandb and generating plots
tests
: directory with the same structure asvalidyna
containing tests per file
Current experiment configurations are in the folder experiment_configs
.
To run an experiment, execute the command: python validyna/main.py --cfg=path/to/experiment_config.py
(make sure the third installation step is complete).
To add a new experiment config, check the documentation of run_experiment
and run_model_training
in main.py
, as well as ChunkMultiTaskDataset
in data.py
.
You can find the ValiDyna paper here: https://openreview.net/forum?id=sJg-BRQcLxr
If you use ValiDyna in your work, please cite us using the following bibtex:
@inproceedings{streit2022understanding,
title={Understanding Generalization and Robustess of Learned Representations of Chaotic Dynamical Systems},
author={Lu{\~a} Streit and Vikram Voleti and Tegan Maharaj},
booktitle={ICML 2022: Workshop on Spurious Correlations, Invariance and Stability},
year={2022},
url={https://openreview.net/forum?id=sJg-BRQcLxr}
}