Skip to content

Commit

Permalink
Added notebooks to notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
rkdan committed Oct 31, 2024
1 parent a602dea commit 1065163
Show file tree
Hide file tree
Showing 8 changed files with 2,537 additions and 28 deletions.
182 changes: 165 additions & 17 deletions docs/BuildingBlocks/segmentation.ipynb

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions docs/DDPM/4_diffusion.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"metadata": {},
"source": [
"## Variance schedule\n",
"First implement our beta scheduler. It is a fine art choosing the correct schedule."
"First implement our beta scheduler. There are many different types of schedules that can be used, such as linear, cosine, quadratic, etc. We will use a linear schedule to keep things simple. We also need to pick a value for $T$, the number of steps. We will use $T=150$. Adding more steps will increase the quality of the generated images, but will also increase the time it takes to train the model."
]
},
{
Expand Down Expand Up @@ -86,7 +86,7 @@
"x_t = \\sqrt{1 - \\beta_t}x_{t-1} + \\sqrt{\\beta_t}\\epsilon_t\n",
"$$\n",
"\n",
"But of course we have to do this iteratively"
"But of course we have to do this iteratively. The plot below looks at a sample image at different levels of noise."
]
},
{
Expand Down Expand Up @@ -125,7 +125,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Now we define a new variable $\\alpha$ the cumulative product, $\\bar{\\alpha}$, and to make things easier, we also need to define $\\sqrt{\\bar{\\alpha}}$ and $\\sqrt{1-\\bar{\\alpha}}$"
"Now we define a new variable \\\\( \\alpha \\\\) the cumulative product, $\\bar{\\alpha}$, and to make things easier, we also need to define $\\sqrt{\\bar{\\alpha}}$ and $\\sqrt{1-\\bar{\\alpha}}$"
]
},
{
Expand All @@ -151,7 +151,7 @@
"x_t = \\sqrt{\\bar{\\alpha}_t}x_0 + \\sqrt{1-\\bar{\\alpha}_t}\\epsilon\n",
"$$\n",
"\n",
"where $\\epsilon \\sim N(0, 1)$."
"where $\\epsilon \\sim N(0, 1)$"
]
},
{
Expand Down Expand Up @@ -203,7 +203,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Great so it's basically the same"
"Great so it's basically the same as before."
]
},
{
Expand Down
9 changes: 3 additions & 6 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,18 @@

<img src="./imgs/diffusion.webp" alt="Who doesn't love a cat picture" style="width:800px;"/>

Welcome to the Introduction to Diffusion Models workshop offered by the Accelerate Programme for Scientific Discovery. Here you will find the slides for our in-person workshop, along with some material to get started.
Welcome to the Introduction to Diffusion Models workshop offered by the Accelerate Programme for Scientific Discovery. In this workshop, we will learn how to build a diffusion model from scratch!

This workshop was originally delivered in-person at the University of Cambridge, but we have made the slides and some of the material available here for you to work through at your own pace.

In the main GitHub repository, there is a `notebooks` folder that contains the Jupyter notebooks that we used in the workshop. These notebooks are designed to be run on a local machine, and we recommend that you use a machine with a GPU to run them. If you don't have a GPU, you can use Google Colab to run the notebooks. Contained within the main repository is also a folder `diffusion_models` that contains the code for the Diffusion Models that we build in the workshop.

[:fontawesome-solid-book: Notebooks ](mailto:[email protected]){ .md-button }
[:fontawesome-solid-book: Notebooks ](https://github.com/acceleratescience/diffusion-models/tree/main/notebooks){ .md-button }

This workshop is roughly divided into the following sections:

## Introduction
An overview of the Accelerate Programme, and the history of image generation, including:
- VAEs
- GANs
- Diffusion
An overview of the Accelerate Programme, and the history of image generation, including VAEs, GANs, and Diffusion

## Physics
How we can draw inspiration from the world of physics by exploring diffusion in fluids and charge distributions.
Expand Down
18 changes: 18 additions & 0 deletions docs/javascripts/mathjax.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
window.MathJax = {
tex: {
inlineMath: [['$', '$'], ['\\(', '\\)']],
// displayMath: [ ['$$', '$$'], ['\[', '\]'] ],
processEscapes: true,
processEnvironments: true
},
options: {
// ignoreHtmlClass: ".*|",
// processHtmlClass: "arithmatex"
}
};
document$.subscribe(() => {
MathJax.startup.output.clearCache()
MathJax.typesetClear()
MathJax.texReset()
MathJax.typesetPromise()
})
5 changes: 5 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ nav:
- Open Source Communities: OpenSource/index.md
extra_css:
- css/custom.css
extra_javascript:
- javascripts/mathjax.js
- https://unpkg.com/mathjax@3/es5/tex-mml-chtml.js
theme:
favicon: imgs/trace.svg
name: material
Expand Down Expand Up @@ -100,6 +103,8 @@ markdown_extensions:
- pymdownx.highlight
- pymdownx.inlinehilite
- tables
- pymdownx.arithmatex:
generic: true
- pymdownx.emoji:
emoji_index: !!python/name:material.extensions.emoji.twemoji
emoji_generator: !!python/name:material.extensions.emoji.to_svg
Expand Down
783 changes: 783 additions & 0 deletions notebooks/1_VAEs.ipynb

Large diffs are not rendered by default.

Loading

0 comments on commit 1065163

Please sign in to comment.