Skip to content

dcomp-leris/tutorial_timegan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TimeGAN as a Simulator for Reinforcement Learning Training in Programmable Data Planes

by authors

This git shows the codes, graphs, and plots of our tutorial, which has been submitted for publication in SBRC 2024 and NetSoft 2024. You will have access to the Python codes we have used to generate our methodology.

Abstract

This tutorial explores the application of Time Series GAN in a Programmable Data Plane for enhancing Reinforcement Learning within the context of computer networks, particularly in video applications. We address various challenges, including dataset augmentation, balancing, and extended RL training times in real setups. By leveraging synthetic data generated by TimeGAN, we accelerate experimentation, enhance dataset diversity, and simplify RL model training, ultimately evaluating TimeGAN's performance against real setups in resource optimization for PDPs using an RL agent. This research contributes by directly comparing GAN usage and real setups, bridging a gap in computer network literature, and highlighting a 99% similarity in Quality of Service achieved by an RL model trained with synthetic data, affirming TimeGAN's potential as a valuable simulator without compromising RL training efficacy.

Code implementation and references

All source code used to generate the results and figures in the paper are in the code folder. The datasets used in this study is provided in datasets. Figures of the results generated by the code are saved in results.

Using the code

You can download a copy of all the files in this repository by cloning the git repository:

https://github.com/thiagocaproni/tutorial_timegan.git

or download a zip archive.

Dependencies

You'll need Python 3.9.16 to run the code. You can set up an environment with all dependencies using an environment manager like Anaconda Python distribution which provides the conda package manager. Anaconda can be installed in your user directory and does not interfere with the system Python installation. The required dependencies are specified in the file environment.yml.

Run the following command in the repository folder (where environment.yml is located) to create a separate environment and install all required dependencies in it:

conda env create

Datasets

You can find the datasets used in this work in datasets folder.

Reproducing the results

Activate the conda environment:

conda activate ydata

or, on Windows:

activate ydata

To build and produce all results and figures, follow these steps:

Training the models

The training scripts are in code/timegan/train. In this folder there are two scripts: timegan32.py and timegan64.py. As detailed in our paper, we generated synthetic data for two different PDP scenarios: 32 and 64 packets in switch buffers.

Generating synthetic data from models

The script to generate synthetic data is in code/timegan/data_generation/generate_synth_data.py.

Evaluating models and generating synthetic datasets

The script for the evaluation and model selection is in code/timegan/evaluation/analyze_data_models.ipynb. You can also find the regressor and PCA / t-SNE analyses in code/timegan/regressor/ folder.

License

All source code is made available under a BSD 3-clause license. You can freely use and modify the code, without warranty, so long as you provide attribution to the authors.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published