This repository contains the code for the paper Learning Physical Concepts in CPS: A Case Study with a Three-Tank System. All experiments and the figures contained in the paper should be reproducible.
This repo is structured as follows:
.
├── .gitignore
├── README.md --> this field :)
├── data --> dataset for all solutions
├── figures --> all paper figurers
├── setup.py --> for package installation
├── solution1 --> subfolder for solution
│ ├── constants.py --> hyperparameters, constants, ...
│ ├── datagen --> code for data generation
│ ├── scripts --> scripts to run the experiment
│ │ ├── create_figures.py
│ │ ├── generate_data.py
│ │ └── run_training.py
│ └── seq2seq-vae --> model code
│ └── ...
├─ solution2
│ └── ...
...
To install the required packages, run the following from the project root of this repo:
conda create -n concept-learning-cps python=3.9
conda activate concept-learning-cps
pip install -e .
Each of the solutions has its own subdirectory in this repo and consists of three main steps:
- Generate the data sets
- Train the model
- Generate result visualizations
The following commands will run those steps for solution 1. The other experiment can be reproduced accordingly. From the project root and with the new environment activated:
ipython solution1/scripts/generate_data.py
ipython solution1/scripts/run_training.py
ipython solution1/scripts/create_figures.py