ratschlab / RGAN

Recurrent (conditional) generative adversarial networks for generating real-valued time series data.
https://arxiv.org/abs/1706.02633
MIT License
639 stars 183 forks source link

NameError: name 'clip_disc_weights' is not defined #12

Closed eggachecat closed 6 years ago

eggachecat commented 6 years ago

Hi, When I change the setting file to enable WGAN and WGAN_clip and run the model, it gives the Error:
NameError: name 'clip_disc_weights' is not defined Should I give clip_disc_weights a value that constraint the weight value of the network?

Thanks !!

eggachecat commented 6 years ago

Find raise NotImplementedError

corcra commented 6 years ago

Ah, we found that the Wasserstein objective didn't work for this model, so all the functions to use it are probably broken. Sorry... (hence the NotImplementedErrors)

ghost commented 6 years ago

@corcra Hi, can I ask why is that?! It is too bad because I think WGAN is more easier to track the performance than TSTR.. And @corcra may I ask some question about your paper? In the eICU experiment generating SpO2, HR, RR and MAP, do RGAN generate a multi-dimensional time series which means implicitly learning the relation between the four variable or simply generate time series for four times? Thanks a lot!

corcra commented 6 years ago

WGAN-clip just gave poor results empirically (probably because clipping the weights of an RNN doesn't result in exactly the desired Lipschitz-1 restraint/may be overly harsh), and WGAN using the gradient penalty is not supported in Tensorflow. At least at the time I was trying to implement it, calculating the gradient of a gradient involving a for loop (as you get in an RNN) is simply not supported. Extending Tensorflow to capture that case was going to be too much of an engineering effort. I tried a cheap hack at approximating the gradient (it's still in the code), but it didn't work very well, so we dropped it. But it may be possible in another framework (e.g. PyTorch), or maybe it's even been added to Tensorflow since I first tried it.

Re: the eICU experiment: as the generator is a LSTM, we generate the time-series for each variable simultaneously (it is a multidimensional time series). Theoretically if it can generate realistic data, this includes learning the relationships between each variable. Similarly, the discriminator sees the whole multidimensional time series, and ideally can pick up on unrealistic correlations between individual variables. One could theoretically compare with models generating each time series independently to see how important this multidimensional aspect is - clearly for MNIST it's important, but it's possible the correlations between these ICU variables are less pronounced (although medically it makes sense that they are related).

ghost commented 6 years ago

@corcra Wow thanks so much for your reply!