A library to easily train various existing GANs in PyTorch.
Project description
# VeGANs
A library providing various existing GANs in PyTorch.
This library targets mainly GAN users, who want to use existing GAN training techniques with their own generators/discriminators.
However researchers may also find the GAN base class useful for quicker implementation of new GAN training techniques.
The focus is on simplicity and providing reasonable defaults.
## How to install
`pip install vegans`
## How to use
The basic idea is that the user provides discriminator and generator networks, and the library takes care of training them in a selected GAN setting:
```
from vegans import WGAN
from vegans.utils import plot_losses, plot_image_samples
# Create your critic and generator
netD = Discriminator().to(device)
netG = Generator().to(device)
# Build a Wasserstein GAN
gan = WGAN(netG, netD, dataloader, ngpu=1, nr_epochs=20)
# train it
gan.train()
# vizualise results
img_list, D_losses, G_losses = gan.get_training_results()
plot_losses(G_losses, D_losses)
plot_image_samples(img_list, 50)
```
Currently the best way to learn more about how to use VeGANs is to have a look at the example [notebooks](https://github.com/unit8co/vegans).
## Contribute
PRs and suggestions are welcome.
## Credits
Some of the code has been inspired by some existing GAN implementations:
* https://github.com/eriklindernoren/PyTorch-GAN
* https://github.com/martinarjovsky/WassersteinGAN
* https://pytorch.org/tutorials/beginner/dcgan_faces_tutorial.html
A library providing various existing GANs in PyTorch.
This library targets mainly GAN users, who want to use existing GAN training techniques with their own generators/discriminators.
However researchers may also find the GAN base class useful for quicker implementation of new GAN training techniques.
The focus is on simplicity and providing reasonable defaults.
## How to install
`pip install vegans`
## How to use
The basic idea is that the user provides discriminator and generator networks, and the library takes care of training them in a selected GAN setting:
```
from vegans import WGAN
from vegans.utils import plot_losses, plot_image_samples
# Create your critic and generator
netD = Discriminator().to(device)
netG = Generator().to(device)
# Build a Wasserstein GAN
gan = WGAN(netG, netD, dataloader, ngpu=1, nr_epochs=20)
# train it
gan.train()
# vizualise results
img_list, D_losses, G_losses = gan.get_training_results()
plot_losses(G_losses, D_losses)
plot_image_samples(img_list, 50)
```
Currently the best way to learn more about how to use VeGANs is to have a look at the example [notebooks](https://github.com/unit8co/vegans).
## Contribute
PRs and suggestions are welcome.
## Credits
Some of the code has been inspired by some existing GAN implementations:
* https://github.com/eriklindernoren/PyTorch-GAN
* https://github.com/martinarjovsky/WassersteinGAN
* https://pytorch.org/tutorials/beginner/dcgan_faces_tutorial.html
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
vegans-0.1.0.tar.gz
(6.9 kB
view details)
Built Distribution
File details
Details for the file vegans-0.1.0.tar.gz
.
File metadata
- Download URL: vegans-0.1.0.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.9.0 tqdm/4.30.0 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae45ccc8492b04e91a1b6ef344e5383beb127fe0158862f3714d938cecd4fa63 |
|
MD5 | e7c534ddcc179405b5fdc2269236d740 |
|
BLAKE2b-256 | 7c0710371d0daf49db6604235f307731998e4a02dd05d643ec2a52bddebca8ee |
File details
Details for the file vegans-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: vegans-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.9.0 tqdm/4.30.0 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | af9f76ec4cf8763aa437f21437fb280deb00c0abee24b60c469820b31f6e7001 |
|
MD5 | 2f83c52d6a083adb03713fc846b9c4a8 |
|
BLAKE2b-256 | cf051ba6c7edf08ef6a85db5c504eef95382fdfc134914c8094602116b941053 |