Implementation of C-RNN-GAN.

Overview

Implementation of C-RNN-GAN.

Publication: Title: C-RNN-GAN: Continuous recurrent neural networks with adversarial training Information: http://mogren.one/publications/2016/c-rnn-gan/

Bibtex:

@inproceedings{mogren2016crnngan, title={C-RNN-GAN: A continuous recurrent neural network with adversarial training}, author={Olof Mogren}, booktitle={Constructive Machine Learning Workshop (CML) at NIPS 2016}, pages={1}, year={2016} }

A generative adversarial model that works on continuous sequential data. Implementation uses Python and Tensorflow, and depends on https://github.com/vishnubob/python-midi for MIDI file IO.

Requirements

tensorflow, python-midi (or python3-midi)

How to run?

python rnn_gan.py --datadir "relative-path-to-data" --traindir "path-to-generated-output" --feed_previous --feature_matching --bidirectional_d --learning_rate 0.1 --pretraining_epochs 6

Author: Olof Mogren (olofmogren) Contributors: Dhruv Sharma (dhruvsharma1992)

Comments
  • Problems in tensorflow 1.2.0

    Problems in tensorflow 1.2.0

    Hi, I'd like to run your rnn_gan.py, but probably because I'm using the latest version of tensorflow, I have a problem. The script doesn't work. I modified several lines because in tensorflow 1.2.0 they change the ordering, notation, and so on. Also, since we don't have tf.nn.bidirectional_rnn in tensorflow 1.2.0, I tried other bidirectional rnn. Then I got some errors, (mostly ValueErrors, rank incorrespondence, different input shape, etc...)

    I'm using Ubuntu 14.04 with GeForce GTX TITAN X (12GB). Is it because of the different version of tensorflow? or Am I missing some points? Also, could you tell me which version of tensorflow you're using?

    Thanks.

    opened by tyashima 11
  • Tensorflow version

    Tensorflow version

    Hi, Great work with the code! My question is which Tensorflow version did you use to compile it and is there a 1.3.0 version available?

    Thanks in advance

    opened by gcunhase 4
  • A question relate to the D structure

    A question relate to the D structure

    Hi, I realize a rnn-gan on a sequence data rencently. But I found the D_loss is close to zero fast and G_loss not converged for a long time when I add a RNN in D-net.And everything is OK when I discard the rnn structure in D-net.Why that could be happened?Or should I use the bidirectional rnn structure as your paper used?

    opened by zxiaomzxm 4
  • What version of Python?

    What version of Python?

    Hi, Thanks for sharing your code. I was just wondering what version of Python have you used to implement your code? I tried a couple of different versions (e.g., 2.7.9, 2.7.13, 3.5.0, and 3.5.2), but each had their own problems. For example, the pythonMidi is sucessfully installed with 2.7.9, but it does not support TensorFlow, while 3.5.2 work with TensorFlow, but not pythonMidi! So, I am wondering which version of Python have you used which is compatible with both pythonMidi and TensorFlow. Thanks, Nima

    opened by nimaocr 3
  • Memory Leak after every session.run

    Memory Leak after every session.run

    Hi, I tried to run rnn-gan.py with command line --model small --datadir data/examples/ --traindir data/traindir/ --select_validation_percentage 20 --select_test_percentage 20 but this program run out of memory.

    And I found that during pre-training period every session.run in function run_epoch leaked some memory when debugging. Every 10 "session.run"s cost about 70M RAM so that after 3 epoch of pre-training this program run out of memory. I don't know how it leaked my memory. I hope anyone could solve this error.

    I worked on 8GB memory, GTX850M, Ubuntu 16.04

    Thanks Lvgen

    opened by roreagan 2
  • Keras

    Keras

    Hi. Great work. Could you please provide a Keras implementation of the model? I had an idea for testing the model for signal synthesis of some kind but I'm not familiar with TF. Thanks

    opened by farahmand-m 1
  • Bugs report for your code

    Bugs report for your code

    Hi, my name is Shixian Wen. I am currently a computer science Ph.D. student at University of Southern California. Your code is great, but I found some small bugs that could be some problems. 1: in line #250 you cannot define MultiRNNCell([lstm_cell] * FLAGS.num_layers_g, state_is_tuple=True) like this. you should use something like [cell for _ in range(config.num_layers)] in https://github.com/tensorflow/models/blob/master/tutorials/rnn/ptb/ptb_word_lm.py official tutorial. The reason is here https://stackoverflow.com/questions/45456116/valueerror-trying-to-share-variable-enco-gru-cell-gates-kernel-but-specified-s

    2: you did not update the state c and state h for discriminator and generator: You were trying to update the state in generator from #557 to #559 for generator, but you comment it out. You did not update the state of discriminator at all. see the code in ptb_word_lm.py #402 to #402 The reason is here: https://stackoverflow.com/questions/40991975/how-are-the-batches-iterated-in-the-ptb-lstm-example-of-tensorflow/40998815#40998815

    opened by shixianwen 1
  • Tensorflow issue

    Tensorflow issue

    I am trying to run the code with Tensorflow 1.15.0 but I am having issues. Could you please let me know what version of tensorflow are you using here?

    opened by AbdelouahabKhelifati 0
  • How to generate new music?

    How to generate new music?

    Thank you very much for sharing. I am a student who has just come into contact with music generation. I found that the code seems to only train the network , But not generate new music with midi format. How can I generate new midi format music?

    opened by JackieQiang 0
Owner
Olof Mogren
Research scientist, PhD, at Research institutes of Sweden. Working with deep learning. For more info, check out my web page.
Olof Mogren
A pytorch implementation of Pytorch-Sketch-RNN

Pytorch-Sketch-RNN A pytorch implementation of https://arxiv.org/abs/1704.03477 In order to draw other things than cats, you will find more drawing da

Alexis David Jacq 172 Dec 12, 2022
Pytorch implementation of the popular Improv RNN model originally proposed by the Magenta team.

Pytorch Implementation of Improv RNN Overview This code is a pytorch implementation of the popular Improv RNN model originally implemented by the Mage

Sebastian Murgul 3 Nov 11, 2022
📝 Wrapper library for text generation / language models at char and word level with RNN in TensorFlow

tensorlm Generate Shakespeare poems with 4 lines of code. Installation tensorlm is written in / for Python 3.4+ and TensorFlow 1.1+ pip3 install tenso

Kilian Batzner 63 May 22, 2021
Algorithmic Trading using RNN

Deep-Trading This an implementation adapted from Rachnog Neural networks for algorithmic trading. Part One — Simple time series forecasting and this c

Hazem Nomer 29 Sep 4, 2022
LSTMs (Long Short Term Memory) RNN for prediction of price trends

Price Prediction with Recurrent Neural Networks LSTMs BTC-USD price prediction with deep learning algorithm. Artificial Neural Networks specifically L

null 5 Nov 12, 2021
Implements Stacked-RNN in numpy and torch with manual forward and backward functions

Recurrent Neural Networks Implements simple recurrent network and a stacked recurrent network in numpy and torch respectively. Both flavours implement

Vishal R 1 Nov 16, 2021
keyframes-CNN-RNN(action recognition)

keyframes-CNN-RNN(action recognition) Environment: python>=3.7 pytorch>=1.2 Datasets: Following the format of UCF101 action recognition. Run steps: Mo

null 4 Feb 9, 2022
Using a Seq2Seq RNN architecture via TensorFlow to predict future Bitcoin prices

Recurrent Bitcoin Network A Data Science Thesis Project About This repository contains the source code for implementing Bitcoin price prediciton using

Frizu 6 Sep 8, 2022
RNN Predict Street Commercial Vitality

RNN-for-Predicting-Street-Vitality Code and dataset for Predicting the Vitality of Stores along the Street based on Business Type Sequence via Recurre

Zidong LIU 1 Dec 15, 2021
Emotion classification of online comments based on RNN

emotion_classification Emotion classification of online comments based on RNN, the accuracy of the model in the test set reaches 99% data: Large Movie

null 1 Nov 23, 2021
Static Features Classifier - A static features classifier for Point-Could clusters using an Attention-RNN model

Static Features Classifier This is a static features classifier for Point-Could

ABDALKARIM MOHTASIB 1 Jan 25, 2022
Implementation of 'lightweight' GAN, proposed in ICLR 2021, in Pytorch. High resolution image generations that can be trained within a day or two

512x512 flowers after 12 hours of training, 1 gpu 256x256 flowers after 12 hours of training, 1 gpu Pizza 'Lightweight' GAN Implementation of 'lightwe

Phil Wang 1.5k Jan 2, 2023
Implementation of TransGanFormer, an all-attention GAN that combines the finding from the recent GanFormer and TransGan paper

TransGanFormer (wip) Implementation of TransGanFormer, an all-attention GAN that combines the finding from the recent GansFormer and TransGan paper. I

Phil Wang 146 Dec 6, 2022
PyTorch 1.5 implementation for paper DECOR-GAN: 3D Shape Detailization by Conditional Refinement.

DECOR-GAN PyTorch 1.5 implementation for paper DECOR-GAN: 3D Shape Detailization by Conditional Refinement, Zhiqin Chen, Vladimir G. Kim, Matthew Fish

Zhiqin Chen 72 Dec 31, 2022
This is a pytorch implementation of the NeurIPS paper GAN Memory with No Forgetting.

GAN Memory for Lifelong learning This is a pytorch implementation of the NeurIPS paper GAN Memory with No Forgetting. Please consider citing our paper

Miaoyun Zhao 43 Dec 27, 2022
[CVPR 2021] Pytorch implementation of Hijack-GAN: Unintended-Use of Pretrained, Black-Box GANs

Hijack-GAN: Unintended-Use of Pretrained, Black-Box GANs In this work, we propose a framework HijackGAN, which enables non-linear latent space travers

Hui-Po Wang 46 Sep 5, 2022
Official Implementation of LARGE: Latent-Based Regression through GAN Semantics

LARGE: Latent-Based Regression through GAN Semantics [Project Website] [Google Colab] [Paper] LARGE: Latent-Based Regression through GAN Semantics Yot

null 83 Dec 6, 2022
Pytorch implementation of CVPR2021 paper "MUST-GAN: Multi-level Statistics Transfer for Self-driven Person Image Generation"

MUST-GAN Code | paper The Pytorch implementation of our CVPR2021 paper "MUST-GAN: Multi-level Statistics Transfer for Self-driven Person Image Generat

TianxiangMa 46 Dec 26, 2022
Partial implementation of ODE-GAN technique from the paper Training Generative Adversarial Networks by Solving Ordinary Differential Equations

ODE GAN (Prototype) in PyTorch Partial implementation of ODE-GAN technique from the paper Training Generative Adversarial Networks by Solving Ordinary

Somshubra Majumdar 15 Feb 10, 2022