
PyTorch-GAN
A collection of PyTorch code examples for many GAN research papers, one script per model.
- Stars
- 17.5k
- Forks
- 4k
- Licence
- MIT
- Language
- Python
- Last update
- 2.4 years ago
- Type
- Learning resource
No commits in over a year — check for forks or alternatives before adopting.
What it is
This repository contains PyTorch implementations of many Generative Adversarial Network (GAN) variants taken from research papers. GANs are neural networks that learn to generate new data, such as images, by pitting a generator against a discriminator. Each model lives in its own folder with a runnable script, so people use it to study or experiment with how these methods work. The author notes the architectures do not always match the papers exactly and the focus is on core ideas. The author also says the project is no longer maintained.
- Run the ACGAN or AAE example script to see a small GAN train from the command line
- Download an image-to-image dataset with the provided script and run the BicycleGAN example
- Read the per-model Python files to compare how different GAN losses are implemented
Great for
- Students learning how different GAN variants differ in code
- Developers who want a runnable PyTorch starting point for a specific GAN paper
- Researchers comparing core ideas across several GAN papers
- People who want to experiment with pix2pix, CycleGAN, or StarGAN style image translation
Not ideal for
- Anyone needing production-ready or actively maintained code, since the README says the repo has gone stale and is not maintained
- People who need exact replications of paper architectures, since the README says layer configurations may differ from the papers
- Non-programmers, since it requires running Python scripts and installing dependencies
How to get it
- 1
Clone and build from source
You'll need: Python 3 · pip
Clone the repository
git clone https://github.com/eriklindernoren/PyTorch-GANEnter the project folder
cd PyTorch-GAN/Install requirements
sudo pip3 install -r requirements.txt - 2
Run it
- Install the requirements from requirements.txt
- Pick a model folder, such as implementations/acgan/
- Run its script with python3, for example python3 acgan.py
- 3
Get the most out of it
- Use the paper links in each section to read the method alongside the code
- For BicycleGAN and pix2pix style models, download the matching dataset with the provided data scripts first
- Check the sibling Keras-GAN repository linked in the README for a comparison implementation
Downloads
Strengths
- Covers a wide range of GAN papers in one place, each with a link to its paper
- Each model has a short run example in its README section
- Uses PyTorch, a widely used Python deep learning library
Trade-offs
- The README states the project is no longer maintained and seeks a collaborator
- Architectures may not match the original papers exactly
- Installation uses sudo pip3 install, and dependencies are not detailed in the README
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.