lightning/examples/fabric/dcgan
Jirka Borovec 99fe6563ef
precommit: ruff-format (#19434)
* precommit: ruff-format

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* manual update

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* manual update

* order

* mypy

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* mypy

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-02-15 13:39:17 -05:00
..
README.md docs: update broken links & latest/stable (#16994) 2023-03-15 20:19:41 +01:00
train_fabric.py precommit: ruff-format (#19434) 2024-02-15 13:39:17 -05:00
train_torch.py precommit: ruff-format (#19434) 2024-02-15 13:39:17 -05:00

README.md

DCGAN

This is an example of a GAN (Generative Adversarial Network) that learns to generate realistic images of faces. We show two code versions: The first one is implemented in raw PyTorch, but isn't easy to scale. The second one is using Lightning Fabric to accelerate and scale the model.

Tip: You can easily inspect the difference between the two files with:

sdiff train_torch.py train_fabric.py
Real Generated
sample-data fake-7914

Run

Raw PyTorch:

python train_torch.py

Accelerated using Lightning Fabric:

python train_fabric.py

Generated images get saved to the outputs folder.

Notes

The CelebA dataset is hosted through a Google Drive link by the authors, but the downloads are limited. You may get a message saying that the daily quota was reached. In this case, manually download the data through your browser.

References