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

Where is model saved? Output Access & Visualization #7

Closed ArturoDeza closed 7 years ago

ArturoDeza commented 7 years ago

I'm not quite sure where the model is saved, and if there is a predefined script where I can essentially run a forward pass of the model, and visualize (or have access) to the output vector.

corcra commented 7 years ago

During training, the model parameters are periodically saved (https://github.com/ratschlab/RGAN/blob/master/experiment.py#L368), using the dump_parameters function (see models.py: https://github.com/ratschlab/RGAN/blob/master/model.py#L300). These go into a /parameters/ folder under the main directory.

To sample from a trained model, you want sample_trained_model (also in models.py, https://github.com/ratschlab/RGAN/blob/master/model.py#L322). This function is a bit particular to my setup/folder hierarchy. It expects you to provide it with the name of a settings file (see: https://github.com/ratschlab/RGAN/blob/master/model.py#L328), which it expects in a /settings/ folder. It will read the settings file to find the experiment identifier (in my case I always just used the same string for the name of the settings file and the experiment identifier), and load the aforementioned parameters. It also wants you to provide an epoch, since there are typically parameters from many epochs saved, and you may wish to sample from a non-final model (e.g. doing early stopping).

I hope this clears it up!

ShashankaGE commented 4 years ago

Hi @corcra! I am confused about how to generate data by parameters saved while running 'eICU_synthetic_dataset_generation.py'. sample_trained_model from model.py is not working as the names of values in parameters from 'eICU_synthetic_dataset_generation.py' are different from 'experiment.py'.