anvoynov / GANLatentDiscovery

The authors official implementation of Unsupervised Discovery of Interpretable Directions in the GAN Latent Space
416 stars 52 forks source link

Across-class or "global" directions from conditional GAN? #14

Open jbmaxwell opened 3 years ago

jbmaxwell commented 3 years ago

I'm working with a conditional GAN and finding this model very useful for finding within-class directions, but I'm curious whether it could be used for across-class, or global, directions? The way I'm using it now is to find intelligible variations within each of my classes, but it would also be very useful to have an intuitive way to "morph" between classes.

Any thoughts appreciated.

anvoynov commented 3 years ago

Hi @jbmaxwell, The BigGAN's directions are generally cross-class and commonly applicable for each one (though some of the classes, e.g. landscapes have no ``background''). In practice, I have not seen any merits or benefits in training BigGAN's rectification with a single class or with all: commonly it converges more or less to the same semantic directions. You can pass all of your classes as the target_class argument: https://github.com/anvoynov/GANLatentDiscovery/blob/master/run_train.py#L27

Apparently, you mean a latent direction that also takes care of a class? Something like h = (v, v_class) s.t. z_shifted = (z + v, class + t)? Have not thought of that, interesting idea. It should be easy to patch the deformator so that it could modify a class label as well. If you try it – please, let me know about the results.

jbmaxwell commented 3 years ago

Yes, I was curious about the idea of a latent direction that basically finds similarities between classes, so it could potentially shift across multiple classes in an interpretable way (e.g., small dog -> large dog -> horse). I'll have a look at your thought of modifying the class label in the deformator. Thanks.