I previously recommended a GAN framework based on TensorFlow — Google’s open source GAN library –TFGAN.

There is also a new GAN framework tool that is based on Pytorch. The project address is:

Github.com/torchgan/to…

For those of you who are used to using the Pytorch framework, you can now use this open source project to quickly build a GAN network model!

The open source project currently has 400+ stars and provides installation tutorials, API documentation, and usage tutorials. The documentation address is as follows:

torchgan.readthedocs.io/en/latest/

The installation

For TorchGAN installation, the official website provides three methods, but in fact, only two installation methods are supported, respectively PIP installation and source installation, and the conda installation method is not supported at present.

Pip Installation method

To install the latest release, run the following command:

$ pip3 install torchgan
Copy the code

For the latest version:

$ pip3 install git+https://github.com/torchgan/torchgan.git
Copy the code
Conda installation

This installation method is not supported in the current version and will be implemented in v0.1.

Source code installation

Execute the following commands in order to install from source

$ git clone https://github.com/torchgan/torchgan
$ cd torchgan
$ python setup.py install
Copy the code
Dependent libraries

Must follow the dependency library:

  • Numpy
  • Pytorch 0.4.1
  • Torchvision

optional

  • TensorboardX: Mainly for adoptionTensorboardTo observe and record the results. Installation by Commandpip install tensorboardX
  • Visdom: For adoptionXisdomTake notes. Installation by Commandpip install visdom

The API documentation

The API documentation directory is as follows:

The catalog is divided into the following categories:

  • Torchgan. Layers: Includes some network layers commonly used to build GAN structures, including residual blocks, self-attention, Spectral Normalization, and so on
  • Torchgan.logging: Provides a powerful interface for visualization tools, including visualization of loss functions, gradients, measurement criteria, and generated images
  • Torchgan. Losses function of common training GANs model, including original antagonism loss, least square loss, WGAN loss function, etc.
  • Torchgan. metrics: Mainly provides different measurement criteria
  • Torchgan. Models: Contains common GAN network structures, which can be directly used or extended, including DCGAN and cGAN
  • Torchgan. Trainer: Mainly provides the functional interface of the training model

The tutorial

The tutorial section looks like this:

The tutorial gives several examples, including DCGAN, self-attention GAN, CycleGAN examples, and how to customize damage methods.

For self-attention GAN, an example running on Google’s Colab is provided. Check out the link:

Torchgan. Readthedocs. IO/en/latest/t…


summary

Finally, Github project link and corresponding document link address are given:

Github.com/torchgan/to…

Torchgan. Readthedocs. IO/en/latest/I…

Welcome to follow my wechat official account – Machine Learning and Computer Vision, or scan the qr code below, we can communicate, learn and progress together!

Previously shared resources and tutorial articles are:

  • Several books and courses on data structure algorithms are recommended
  • Github deep Learning 500 questions
  • The Latest machine Learning Training Secrets by Ng can be downloaded for free in Chinese.
  • TensorFlow is now available in Chinese
  • Must-read AI and Deep learning blog
  • An easy-to-understand TensorFlow tutorial
  • Google’s open source GAN library, TFGAN