Skip to content

Implementation of FastGAN Model in Tensorflow / Keras

License

Notifications You must be signed in to change notification settings

milmor/self-supervised-gan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Self-Supervised GAN

Implementation of the FastGAN model in the paper:

Towards Faster and Stabilized GAN Training for High-fidelity Few-shot Image Synthesis.

Gen architecture Disc architecture

See here for the official Pytorch implementation.

Examples

Dependencies

  • Python 3.8
  • Tensorfow 2.8
  • Tensorflow Addons 0.16

Usage

Train

Use --file_pattern=<file_pattern> to specify the dataset path and file pattern.

python train.py --file_pattern=./dataset_path/*.png

Generate

Use --main_dir=<main_dir> to specify the model directory name.

python generate.py --main_dir=<main_dir>

Hparams setting

Adjust hyperparameters in the hparams.py file.

Tensorboard

Run tensorboard --logdir ./.

References

Code:

  • This model depends on other files that may be licensed under different open source licenses.
  • Self-Supervised GAN uses Differentiable Augmentation. Under BSD 2-Clause "Simplified" License.

Implementation notes:

  • Self-supervised discriminator with a single reconstruction decoder and perceptual loss.
  • Hinge loss GAN and WGAN gradient penalty.
  • Skip-layer excitation generator.
  • Orthogonal initialization.
  • Adam with β1 = 0.5 and β2 = 0.99.
  • Batch size = 8.

Licence

MIT