This repository provides the code accompanying the thesis, "Learning Compressed Representations of Emission Inventories in Urban Environments."
A variational autoencoder (VAE) is trained to generate urban emission flux fields. The dataset is derived from the TNO-GHGco-v1.1 (2015) and TNO-GHGco-v4 (2018) high resolution inventories by extracting individual cities with a population size of greater than 100,000 citizens.
This generator is then used to generate solutions to an inverse problem using a latent space optimization based on stochastic gradient descent.
The inverse problem is the following:
Based on measurements and the atmospheric transport of molecules, derive a emission flux field that best represents these measurements.
Decoder of the VAE (Generator Function G)
The following section shows a reconstruction example for Munich emission fluxes. 50 Measurements are taken at 13 sensor locations with a signal to noise (SNR) ratio of 20dB. The atmospheric transport is simulated using a Gaussian plume simulation (advection diffusion equation).
The emission flux field of Munich from 2018 looks as follows:
VAE (Fine-tuned) |
VAE |
Sparse Reconstruction (DCT) |
Regularized Least Squares |
poetry install
A guide on the required datasets and how to get them will be added in the future. This includes the VAE models weights.
Note:
Thepoetry run
prefix is not required if the virtual environment is already activated usingpoetry shell
.
poetry run preprocess-tno [-h] [-gw W] [-gh H] [-p N] [-v]
poetry run train-vae [-h] [-e N] [-d N] [-v p] [-t p] [-wandb]
poetry run finetune-vae [-h] [-e N] -c C -b M
There are some Jupyter notebooks, especially for plotting and visualizations. These need to be run either in Jupyter Notebook or Jupyter Lab if the IDE does not support Jupyter notebooks. They can be started as follows:
Jupyter Notebook
poetry run jupyter-notebook
Jupyter Lab
poetry run jupyter-lab
There are some scripts in this repository.
Notably, in src/experiments
, some experiments are located.
A script with name <script>
can be run as follows:
poetry run python src/experiments/<script> <args>
poetry run pre-commit install