{"cells": [{"cell_type": "markdown", "id": "7a37951c", "metadata": {"papermill": {"duration": 0.023386, "end_time": "2021-09-16T12:40:39.258673", "exception": false, "start_time": "2021-09-16T12:40:39.235287", "status": "completed"}, "tags": []}, "source": ["\n", "# Tutorial 7: Deep Energy-Based Generative Models\n", "\n", "* **Author:** Phillip Lippe\n", "* **License:** CC BY-SA\n", "* **Generated:** 2021-09-16T14:32:29.871712\n", "\n", "In this tutorial, we will look at energy-based deep learning models, and focus on their application as generative models.\n", "Energy models have been a popular tool before the huge deep learning hype around 2012 hit.\n", "However, in recent years, energy-based models have gained increasing attention because of improved training methods and tricks being proposed.\n", "Although they are still in a research stage, they have shown to outperform strong Generative Adversarial Networks\n", "in certain cases which have been the state of the art of generating images\n", "([blog post](https://ajolicoeur.wordpress.com/the-new-contender-to-gans-score-matching-with-langevin-sampling/)about strong energy-based models,\n", "[blog post](https://medium.com/syncedreview/nvidia-open-sources-hyper-realistic-face-generator-stylegan-f346e1a73826) about the power of GANs).\n", "Hence, it is important to be aware of energy-based models, and as the theory can be abstract sometimes,\n", "we will show the idea of energy-based models with a lot of examples.\n", "This notebook is part of a lecture series on Deep Learning at the University of Amsterdam.\n", "The full list of tutorials can be found at https://uvadlc-notebooks.rtfd.io.\n", "\n", "\n", "---\n", "Open in [{height=\"20px\" width=\"117px\"}](https://colab.research.google.com/github/PytorchLightning/lightning-tutorials/blob/publication/.notebooks/course_UvA-DL/07-deep-energy-based-generative-models.ipynb)\n", "\n", "Give us a \u2b50 [on Github](https://www.github.com/PytorchLightning/pytorch-lightning/)\n", "| Check out [the documentation](https://pytorch-lightning.readthedocs.io/en/latest/)\n", "| Join us [on Slack](https://join.slack.com/t/pytorch-lightning/shared_invite/zt-pw5v393p-qRaDgEk24~EjiZNBpSQFgQ)"]}, {"cell_type": "markdown", "id": "7f00f90d", "metadata": {"papermill": {"duration": 0.021442, "end_time": "2021-09-16T12:40:39.301749", "exception": false, "start_time": "2021-09-16T12:40:39.280307", "status": "completed"}, "tags": []}, "source": ["## Setup\n", "This notebook requires some packages besides pytorch-lightning."]}, {"cell_type": "code", "execution_count": 1, "id": "33e8ad5c", "metadata": {"colab": {}, "colab_type": "code", "execution": {"iopub.execute_input": "2021-09-16T12:40:39.347844Z", "iopub.status.busy": "2021-09-16T12:40:39.347375Z", "iopub.status.idle": "2021-09-16T12:40:39.349918Z", "shell.execute_reply": "2021-09-16T12:40:39.349436Z"}, "id": "LfrJLKPFyhsK", "lines_to_next_cell": 0, "papermill": {"duration": 0.026972, "end_time": "2021-09-16T12:40:39.350031", "exception": false, "start_time": "2021-09-16T12:40:39.323059", "status": "completed"}, "tags": []}, "outputs": [], "source": ["# ! pip install --quiet \"torchvision\" \"torch>=1.6, <1.9\" \"tensorboard\" \"matplotlib\" \"pytorch-lightning>=1.3\" \"torchmetrics>=0.3\""]}, {"cell_type": "markdown", "id": "9eea4d0b", "metadata": {"papermill": {"duration": 0.022362, "end_time": "2021-09-16T12:40:39.394135", "exception": false, "start_time": "2021-09-16T12:40:39.371773", "status": "completed"}, "tags": []}, "source": ["