Giter VIP home page Giter VIP logo

Comments (23)

rafaelvalle avatar rafaelvalle commented on May 29, 2024 5

@aosokin
The code for running the GAN is the first link and the models the second. Let me know if you have any questions or figure out your problem!

https://github.com/rafaelvalle/neural_network_control_improvisation/blob/master/wcgan_text.py
https://github.com/rafaelvalle/neural_network_control_improvisation/blob/master/models.py

from wassersteingan.

aosokin avatar aosokin commented on May 29, 2024 3

@appierys Hi, thanks for the notice. Could you share some code snippets on how you did this?

from wassersteingan.

appierys avatar appierys commented on May 29, 2024 2

I've successfully trained a conditional WGAN as well. But I am using WGAN-GP version. Maybe that's the difference?
BTW, I found that I need to keep training even after original WGAN loss is converged.

from wassersteingan.

rafaelvalle avatar rafaelvalle commented on May 29, 2024

Have you tried passing your noise through a dense layer and then concatenating its output with the labels.

from wassersteingan.

aosokin avatar aosokin commented on May 29, 2024

@rafaelvalle Yes, I've tried combining CGAN or ACGAN, but it never worked.
I always saw one of the two failure modes: Wassestein objective converges, but conditioning is just ignored; Wasserstein objective does not converge at all.

from wassersteingan.

rafaelvalle avatar rafaelvalle commented on May 29, 2024

@aosokin Did you try providing both the critic and generator with the condition?
There's some paper, I don't remember which, that suggests using conditioning whenever possible.

from wassersteingan.

LukasMosser avatar LukasMosser commented on May 29, 2024

@rafaelvalle there should be some theoretical reasoning behind this. I would assume that adding the conditioning vector once to the data should be sufficient. I believe that is the case for vanilla GANs.

from wassersteingan.

aosokin avatar aosokin commented on May 29, 2024

@rafaelvalle yes, I've tried several things like they go in the ACGAN paper, but never could make it work.

from wassersteingan.

rafaelvalle avatar rafaelvalle commented on May 29, 2024

@aosokin Did you try looking at the gradients close to your noise and condition vector?
Are the images normalized ?
How many classes do you have and what type of data?

from wassersteingan.

aosokin avatar aosokin commented on May 29, 2024

@rafaelvalle

Did you try looking at the gradients close to your noise and condition vector?

Towards convergence most of the parameters are clipped, so the gradients all look outside.

Are the images normalized ?

yes, to [-1, 1]

How many classes do you have and what type of data?

I've tried 6 classes on some images. I should probably try it on a MNIST, but did not have time.

I'm curious if there is any success story on conditioning WGAN on anything.

from wassersteingan.

rafaelvalle avatar rafaelvalle commented on May 29, 2024

@aosokin I was successful conditioning WGAN on ~70 classes with chromatic images.
I've read that conditional image generation with GANs, not WGANs, benefit from L2 loss. Maybe there's an adaptation go WGAN?
https://arxiv.org/pdf/1611.07004v1.pdf

from wassersteingan.

aosokin avatar aosokin commented on May 29, 2024

@rafaelvalle

I was successful conditioning WGAN on ~70 classes with chromatic images.

Could you share a code snippet on what worked?
Would be very helpful.

I've read that conditional image generation with GANs, not WGANs, benefit from L2 loss.

But that's image conditioned on image, which is even harder. For me, even conditioning on labels did not work. Maybe I just did something wrong.

from wassersteingan.

aosokin avatar aosokin commented on May 29, 2024

@rafaelvalle Great, thanks a lot! I'll try this version out

from wassersteingan.

rafaelvalle avatar rafaelvalle commented on May 29, 2024

@aosokin
Have you tried implementing things from zi2zi: Master Chinese Calligraphy with Conditional Adversarial Networks.

@martinarjovsky any suggestions on how to combine the WGAN loss with a classification loss, say categorical crossentropy?

from wassersteingan.

aosokin avatar aosokin commented on May 29, 2024

@rafaelvalle Hi, I've tried some things along the lines of your code, but it still does not work, but I still observe the same result: the conditioning is ignored in the end of the day.
The key difference to what I as doing before appeared in when to merge image and label signal in the critic: I was doing this early at the image level, you are merging it in later. I've tried both and see no difference.

zi2zi: Master Chinese Calligraphy with Conditional Adversarial Networks.

This seems to do a very different thing.

Have you tried passing your noise through a dense layer and then concatenating its output with the labels.

Yes, I've tried that, but it did not change the outcome at all.

from wassersteingan.

rafaelvalle avatar rafaelvalle commented on May 29, 2024

@aosokin Did you try conditioning à la wavenet, z = tanh(Wk * X + VkC), where * is convolution and W and V are the weights at layer K?

from wassersteingan.

tkoch96 avatar tkoch96 commented on May 29, 2024

@rafaelvalle Hi, trying to view your first link above but it doesn't seem to be working. Could you re-post?

from wassersteingan.

omair-kg avatar omair-kg commented on May 29, 2024

Hi @aosokin , I'm trying something similar with conditional WGAN and observed similar behaviour, either conditioning is completely ignored or the network doesn't converge.

I added a second loss to the generator as well (L2 loss) to 'guide' the results in the correct direction. This setup is pretty sensitive to lambda (the multiplier) for the GAN loss. The training now appears to be headed in the right direction but it is still early days yet.

from wassersteingan.

shaform avatar shaform commented on May 29, 2024

I've spent some time to implement WACGAN-GP for MNIST this morning. The results seem to be acceptable. The sample jupyter notebook is as follows: WACGAN-GP-MNIST

from wassersteingan.

weihancug avatar weihancug commented on May 29, 2024

@appierys Hi,Could you share some code to show how you do it

from wassersteingan.

appierys avatar appierys commented on May 29, 2024

@weihancug Hi, I think the notebook provided above already shows a working conditional WGAN ?
WAGCAN-GP-MNIST

from wassersteingan.

shaform avatar shaform commented on May 29, 2024

I've found other implementations of cWGAN:

Looks like WGAN is ok with conditional settings since many people could reproduce the results.

from wassersteingan.

kongyanye avatar kongyanye commented on May 29, 2024

Here's an implementation of conditional WGAN-GP. https://github.com/kongyanye/cwgan-gp

from wassersteingan.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.