Use Deep Learning Lab to realize GAN (Generative Adversarial Networks)

Hi,

  • PROBLEM
    I am trying to experiment whether KNIME could support creating a GAN network using Deep Learning Lab nodes. But I can’t find a way to combine generator network and discriminator network together.

  • DESCRIPTION
    For example, in one of the calculation steps shown in the below graph:
    When I want to train the generator, I need to keep discriminator locked (not updating its weights in the training process) and update only the weights of the generator.

  1. Connect Generator network with Discriminator network, meaning the latter takes the output of the former.
  2. Update only Generator’s weights at this time, meaning keeping Discriminator locked.

I try nearly every deep learning nodes but seems no one could fulfill these tasks. Does anyone have a thought?

Thanks!

Hello @OliverSong,

the only way you can build a GAN in KNIME is using the DL Python nodes, where you do everything in Python.
While GANs are an interesting development within DL, they are also much more complicated to train, as you need to alternate between training the Generator and Discriminator.
This represents a fundamental difference to most other network styles, which is why we haven’t realized it as KNIME nodes. However, if you are keen to develop such an approach, we are always happy about contributions.

Kind regards,

Adrian

1 Like

Thanks for getting back Adrian! Do you mind also sharing some knowledge of how to use DL Python nodes to realize alternating between training the Generator and Discriminator this kind of repeating logic? From my understanding the DL Python Network Learner node is doing like a “one-time training” job.

It would be awesome if there is a simple example workflow showing what the alternating structure would look like. Much appreciate your time!

Cheers,
Oliver

That is correct, but the GAN training is also just a one-time training job, it just involves a more complex training regime.
I am not sure if I can really market this as a KNIME example workflow since it is essentially only Python but I agree that we are currently lacking examples for these more advanced DL topics.

Kind regards,

Adrian

1 Like

Yes, as far as I tried, current Keras deep learning nodes do not have enough support for GAN. Key issue is there is no way to combine Generator and Discriminator together, as well as lock Discriminator weights in this combined network. Because to update Generator’s weights, the error and backpropagation process starts from the Discriminator’s output, not from Generator’s output, and this learning process is not doable through Keras Network Learner node now.

I would try using only Python node instead to see. Hope this note could help anyone that has same question as me and share some insights for KNIME to develop new supporting nodes.

Cheers,
Oliver

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.