Skip to content

stjordanis/Generative_Deep_Learning_2nd_Edition

Repository files navigation

Generative Deep Learning: Teaching Machines to Paint, Write, Compose and Play

The official code repository for the second edition of the O'Reilly book 'Generative Deep Learning: Teaching Machines to Paint, Write, Compose and Play'

https://learning.oreilly.com/library/view/generative-deep-learning/9781492041931/ https://www.amazon.com/Generative-Deep-Learning-Teaching-Machines/dp/1492041947/ref=sr_1_1

![Generative Deep Learning: Teaching Machines to Paint, Write, Compose and Play](assets/book_cover.png "Generative Deep Learning: Teaching Machines to Paint, Write, Compose and Play" | width=100)

Book Chapters

Part I: Introduction to Generative Deep Learning

  1. Generative Modeling
  2. Deep Learning

Part II: Methods

  1. Variational Autoencoders
  2. Generative Adversarial Networks
  3. Autoregressive Models
  4. Normalizing Flows
  5. Energy-Based Models
  6. Diffusion Models

Part III: Applications

  1. Transformers
  2. Advanced GANs
  3. Music Generation
  4. World Models
  5. Multimodal Models
  6. Conclusion

The subfolders in the notebooks folder correspond to the chapters from the book. Within each chapter, there are several examples of models that are again separated into different folders

Getting Started

Kaggle API

To download some of the datasets for the book, you will need a Kaggle account and an API token

Follow the instructions here:

https://github.com/Kaggle/kaggle-api

Download the JSON file that stores your username and API key.

The .env file

Create a file called .env in the root directory, containing the following values (replacing the Kaggle username and API key with the values from the JSON):

JUPYTER_PORT=8888
TENSORBOARD_PORT=6006
KAGGLE_USERNAME=<your_kaggle_username>
KAGGLE_KEY=<your_kaggle_key>

Running the Examples

Get set up with Docker

To get set up with Docker, follow the instructions in the docker.md file in this repository.

Building the Docker image

If you do not have a GPU, run the following command:

docker-compose build

If you do have a GPU that you wish to use, run the following command:

docker-compose -f docker-compose-gpu.yml build

Running the container

If you do not have a GPU, run the following command:

docker-compose up

If you do have a GPU that you wish to use, run the following command:

docker-compose -f docker-compose-gpu.yml up

The running notebooks will be available in your local browser, on the port specified in your env file - for example

http://localhost:8888

Downloading data

The codebase comes with an in-built data downloader helper script. Use the script as follows:

bash scripts/download.sh [faces, bricks, recipes, flowers, wines, cellosuites, chorales]

Tensorboard

To launch Tensorboard, run the following script, replacing <CHAPTER> with the required chapter (e.g. 03_vae) and <EXAMPLE> with the required example (e.g. 02_vae_fashion).

bash scripts/tensorboard.sh <CHAPTER> <EXAMPLE>

Tensorboard will be available in your local browser on the port specified in your .env file - for example:

http://localhost:6006

About

No description, website, or topics provided.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 94.5%
  • Python 4.1%
  • Shell 1.2%
  • Dockerfile 0.2%