All Projects → ratschlab → Rgan

ratschlab / Rgan

Licence: mit
Recurrent (conditional) generative adversarial networks for generating real-valued time series data.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Rgan

Tensorflow Tutorials
텐서플로우를 기초부터 응용까지 단계별로 연습할 수 있는 소스 코드를 제공합니다
Stars: ✭ 2,096 (+336.67%)
Mutual labels:  gan, rnn, mnist
All About The Gan
All About the GANs(Generative Adversarial Networks) - Summarized lists for GAN
Stars: ✭ 630 (+31.25%)
Mutual labels:  paper, gan, arxiv
Ad examples
A collection of anomaly detection methods (iid/point-based, graph and time series) including active learning for anomaly detection/discovery, bayesian rule-mining, description for diversity/explanation/interpretability. Analysis of incorporating label feedback with ensemble and tree-based detectors. Includes adversarial attacks with Graph Convolutional Network.
Stars: ✭ 641 (+33.54%)
Mutual labels:  time-series, gan, rnn
Alae
[CVPR2020] Adversarial Latent Autoencoders
Stars: ✭ 3,178 (+562.08%)
Mutual labels:  paper, gan
Course-Project---Speech-Driven-Facial-Animation
ECE 535 - Course Project, Deep Learning Framework
Stars: ✭ 63 (-86.87%)
Mutual labels:  gan, rnn
MNIST-invert-color
Invert the color of MNIST images with PyTorch
Stars: ✭ 13 (-97.29%)
Mutual labels:  gan, mnist
GAN-RNN Timeseries-imputation
Recurrent GAN for imputation of time series data. Implemented in TensorFlow 2 on Wikipedia Web Traffic Forecast dataset from Kaggle.
Stars: ✭ 107 (-77.71%)
Mutual labels:  gan, rnn
Medmnist
[ISBI'21] MedMNIST Classification Decathlon: A Lightweight AutoML Benchmark for Medical Image Analysis
Stars: ✭ 338 (-29.58%)
Mutual labels:  mnist, medical
Mydeeplearning
A deep learning library to provide algs in pure Numpy or Tensorflow.
Stars: ✭ 281 (-41.46%)
Mutual labels:  gan, rnn
Time Series Prediction
A collection of time series prediction methods: rnn, seq2seq, cnn, wavenet, transformer, unet, n-beats, gan, kalman-filter
Stars: ✭ 351 (-26.87%)
Mutual labels:  time-series, gan
Tensorflow Generative Model Collections
Collection of generative models in Tensorflow
Stars: ✭ 3,785 (+688.54%)
Mutual labels:  gan, mnist
CS231n
My solutions for Assignments of CS231n: Convolutional Neural Networks for Visual Recognition
Stars: ✭ 30 (-93.75%)
Mutual labels:  gan, rnn
PFL-Non-IID
The origin of the Non-IID phenomenon is the personalization of users, who generate the Non-IID data. With Non-IID (Not Independent and Identically Distributed) issues existing in the federated learning setting, a myriad of approaches has been proposed to crack this hard nut. In contrast, the personalized federated learning may take the advantage…
Stars: ✭ 58 (-87.92%)
Mutual labels:  mnist, rnn
Papernote
paper note, including personal comments, introduction, code etc
Stars: ✭ 268 (-44.17%)
Mutual labels:  paper, arxiv
time series clustering via community detection
Code used in the paper "Time Series Clustering via Community Detection in Networks"
Stars: ✭ 27 (-94.37%)
Mutual labels:  time-series, paper
Basicocr
BasicOCR是一个致力于解决自然场景文字识别算法研究的项目。该项目由长城数字大数据应用技术研究院佟派AI团队发起和维护。
Stars: ✭ 336 (-30%)
Mutual labels:  gan, rnn
Pytorch Mnist Celeba Gan Dcgan
Pytorch implementation of Generative Adversarial Networks (GAN) and Deep Convolutional Generative Adversarial Networks (DCGAN) for MNIST and CelebA datasets
Stars: ✭ 363 (-24.37%)
Mutual labels:  gan, mnist
Wavetorch
🌊 Numerically solving and backpropagating through the wave equation
Stars: ✭ 387 (-19.37%)
Mutual labels:  time-series, rnn
Tsai
Time series Timeseries Deep Learning Pytorch fastai - State-of-the-art Deep Learning with Time Series and Sequences in Pytorch / fastai
Stars: ✭ 407 (-15.21%)
Mutual labels:  time-series, rnn
ZSL-ADA
Code accompanying the paper "A Generative Framework for Zero Shot Learning with Adversarial Domain Adaptation"
Stars: ✭ 18 (-96.25%)
Mutual labels:  paper, gan

RGAN

This repository contains code for the paper, Real-valued (Medical) Time Series Generation with Recurrent Conditional GANs, by Stephanie L. Hyland* (@corcra), Cristóbal Esteban* (@cresteban), and Gunnar Rätsch (@ratsch), from the Ratschlab, also known as the Biomedical Informatics Group at ETH Zurich.

*Contributed equally, can't decide on name ordering

Paper Overview

Idea: Use generative adversarial networks (GANs) to generate real-valued time series, for medical purposes. As the title suggests. The GAN is RGAN because it uses recurrent neural networks for both encoder and decoder (specifically LSTMs).

What does this have to do with medicine?

We aim to generate time series from ICU patients, using the open-access eICU dataset. However, we also generate some non-medical time-series, like sine waves and smooth functions sampled from Gaussian Processes, and MNIST digits (imagined as a time series).

Why generating data at all?

Sharing medical data is hard, because it comes from real people, and is naturally highly sensitive (not to mention legally protected). One workaround for this difficultly would be to create sufficiently realistic synthetic data. This synthetic data could then be used to reproducibly develop and train machine learning models, enabling better science, and ultimately better models for medicine.

When is data 'sufficiently realistic'?

We claim in this paper, that synthetic data is useful when it can be used to train a model which can perform well on real data. So, we use the performance of a classifier trained on the synthetic data, then tested on real data as a measure of the quality of the data. We call this the "TSTR score". This is a way of evaluating the output of a GAN without relying on human perceptual judgements of individual samples.

Differential privacy

We also include the case where the GAN is trained in a differentially private manner, to provide stronger privacy guarantees for the training data. We mostly just use the differentially private SGD optimiser and the moments accountant from here (with some minor modifications).

Code Quickstart

Primary dependencies: tensorflow, scipy, numpy, pandas

Note: This code is written in Python3!

Simplest route to running code (Linux/Mac):

git clone [email protected]:ratschlab/RGAN.git
cd RGAN
python experiment.py --settings_file test

Note: the test settings file is a dummy to demonstrate which options exist, and may not produce reasonable looking output.

Expected Directory Structure

See the directories in this folder: https://github.com/ratschlab/RGAN/tree/master/experiments

Files in this Repository

The main script is experiment.py - this parses many options, loads and preprocesses data as needed, trains a model, and does evaluation. It does this by calling on some helper scripts:

  • data_utils.py: utilities pertaining to data: generating toy data (e.g. sine waves, GP samples), loading MNIST and eICU data, doing test/train split, normalising data, generating synthetic data to use in TSTR experiments
  • model.py: functions for defining ML models, i.e. the tensorflow meat, defines the generator and discriminator, the update steps, and functions for sampling from the model and 'inverting' points to find their latent-space representations
  • plotting.py: visualisation scripts using matplotlib
  • mmd.py: for maximum-mean discrepancy calculations, mostly taken from https://github.com/dougalsutherland/opt-mmd

Other scripts in the repo:

  • eICU_synthetic_dataset_generation.py: essentially self-contained script for training the RCGAN to generate synthetic eICU data
  • eICU_task.py: script to help identify a doable task in eICU, and generating the training data - feel free to experiment with different, harder tasks!
  • eICU_tstr_evaluation.py: for running the TSTR evaluation using pre-generated synthetic dataset
  • eugenium_mmd.py: code for doing MMD 3-sample tests, from https://github.com/eugenium/mmd
  • eval.py: functions for evaluating the RGAN/generated data, like testing if the RGAN has memorised the training data, comparing two models, getting reconstruction errors, and generating data for visualistions of things like varying the latent dimensions, interpolating between input samples
  • mod_core_rnn_cell_impl.py: this is a modification of the same script from TensorFlow, modified to allow us to initialise the bias in the LSTM (required for saving/loading models)
  • kernel.py: some playing around with kernels on time series
  • tf_ops.py: required by eugenium_mmd.py

There are plenty of functions in many of these files that weren't used for the manuscript.

Command line options

TODO

Data sources

MNIST

Get MNIST as CSVs here: https://pjreddie.com/projects/mnist-in-csv/

eICU

eICU is access-restricted, and must be applied for. For more information: http://eicu-crd.mit.edu/about/eicu/

TODO: describe how we preprocess eICU/upload script for doing it

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].