GAN-Steerability-without-optimization icon indicating copy to clipboard operation
GAN-Steerability-without-optimization copied to clipboard

GAN "Steerability" without optimization, ICLR 2021 (Spotlight)

This is an official pytorch implementation

logo

GENERAL

Generally, our methods are coded in the file BigGAN.py. Each path can be extracted by directing the "method" flag accordingly. Full description can be found below. Also, for easier reproducing, you can use main.py.

USER-SPECIFIED GEOMETRIC TRANSFORMATIONS

Closed form solution

Path Flag
Linear 'l_shifty', 'l_zoom' and 'l_shiftx'
Newmann 'nl_shifty', 'nl_zoom' and 'nl_shiftx'
Great circle 'gcircle_shifty', 'gcircle_zoom' and 'gcircle_shiftx'

UNSUPERVISED EXPLORATION OF TRANSFORMATIONS

The principal latent space directios are based on the right singular vectors of the SVD of the FC weight matrix.
Here the flags for the first layer unsupervised paths i.e., all principal latent space directions extracted from the first weight matrix:

Path Flag
Linear 'svd_linear'
Great circle 'svd_gcircle'
Small circle 'svd_scircle'

And here the corresponding paths of other scales:

Path Flag
Linear 'linearin'
Great circle 'greatin'
Small circle 'smallin'

The specific order direction is set by the index parameter.

PLUG AND PLAY

For convenience we also uploaded separate modules for directions and walks. Please see modules.py. You are invited to take the module you need and just plant in your code environment. This allows using separately methods for extracting directions and methods for constructing walks from given directions.

BigGAN model

We downloaded the G_ema.pth for the BigGAN model from here, however you can also use the TFhub and the pytorch implementation. Please see here. You are also invited to explore Imagenet classes here

For any question or issue, write to me! [email protected]