question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Adding GAN support to TensorGraph

See original GitHub issue

I think our current model with TensorGraph can’t nicely support GANs. In order to train GANs, you need to train both a discriminator D and a generator G. The training of these two models is threaded together, with each updated for a few minibatches at a time. While updating the generator, the discriminator weights should be frozen. While updating the discriminator, the generator weights need to be frozen.

I have an idea for a new TensorGraph API to support this sort of training. We add a new layers kwarg to fit:

  • model.fit(feed_generator, layers=None)

The idea is that fit can be instructed to train only some layers at a time. Note that there’s now a semantic change:

  • Layer is responsible for tracking the variables it introduces.
    • layer.variables should be a list of all trainable variables created by that Layer.

@peastman and @lilleswing Does this basic design make sense?

Hat tip to @enf for explaining GAN training to me in detail!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:34 (30 by maintainers)

github_iconTop GitHub Comments

1reaction
peastmancommented, Sep 25, 2017

How about this as a candidate API:

submodel = model.create_submodel(layers, loss, optimizer)
model.fit(dataset, submodel=submodel)

So a submodel specifies a list of layers, a loss function, and an optimizer. When you perform fitting, you can optionally specify a submodel to do the fitting on. It then uses a different train_op, but everything else works exactly the same.

0reactions
pierrebaquecommented, Oct 10, 2017

In the abstract of SeqGAN, they also say the following, which could be very important in my view:

" A major reason lies in that the discrete outputs from the generative model make it difficult to pass the gradient update from the discriminative model to the generative model."

I think that the model that should be used really depends on the kind of data we want to generate. Maybe would it be better to focus on a specific chemical application first?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tutorial Part 16: Conditional Generative Adversarial Network
A Conditional GAN (CGAN) allows additional inputs to the generator and discriminator that their output is conditioned on. For example, this might be...
Read more >
Model Classes — deepchem 2.6.2.dev documentation
DeepChem maintains an extensive collection of models for scientific applications. DeepChem's focus is on facilitating scientific applications, so we support a ...
Read more >
GAN by Example using Keras on Tensorflow Backend
A discriminator that tells how real an image is, is basically a deep Convolutional Neural Network (CNN) as shown in Figure 1. For...
Read more >
PyTorch Support · Issue #843 - GitHub
PyTorch Support #843 ... I think it's time for us to add PyTorch support into DeepChem head. ... Adding GAN support to TensorGraph...
Read more >
Google open sources TensorFlow-GAN (TFGAN) - Packt Hub
Google has open sourced its internal TensorFlow-GAN (TFGAN) library for training and evaluating Generative Adversarial Networks (GANs) ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found