Skip to content

Commit 7ddd0c2

Browse files
authored
Fix typos and improve clarity in index.html
1 parent a44f1da commit 7ddd0c2

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

project-5/index.html

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ <h4>t = 750</h4>
230230
<section id="part-1-3">
231231
<h2>Part 1.3 – Implementing One Step Denoising</h2>
232232

233-
A much more effective method is to use a pretrained diffusion model. Using <code>stage_1.unet</code>, we can estimate the amount of noise in the noisy image. With the forward equation, we can solve for <code>x<sub>0</sub></code> (the original image) given the timestamp <code>t</code>:
233+
A more effective method is to use a pretrained diffusion model. Using <code>stage_1.unet</code>, we can estimate the amount of noise in the noisy image. With the forward equation, we can solve for <code>x<sub>0</sub></code> (the original image) given the timestamp <code>t</code>:
234234

235235
<div class="subsection">
236236
<pre><code>at_x0 = im_noisy_cpu - (1 - alpha_cumprod).sqrt() * noise_est
@@ -298,9 +298,7 @@ <h4>t = 750</h4>
298298
<section id="part-1-4">
299299
<h2>Part 1.4 – Iterative Denoising</h2>
300300

301-
Instead of using one step, we can obtain better results by iterativly denoising from step <code>t</code> until step 0. However, this means running the diffusion model 1000 times in the worst case, which is slow and costly.<br>
302-
<br>
303-
Fortunately, we can speed up the computation by first defining series of strided timestamps, starting at close to 1000 and ending at 0. For the examples below, we will use <code>strided_timestamps = [990, 960, ..., 30, 0]</code>. Then, we can use the formula
301+
Instead of using one step, we can obtain better results by iterativly denoising from step <code>t</code> until step 0. However, this means running the diffusion model 1000 times in the worst case, which is slow and costly. Fortunately, we can speed up the computation by first defining series of strided timestamps, starting at close to 1000 and ending at 0. For the examples below, we will use <code>strided_timestamps = [990, 960, ..., 30, 0]</code>. Then, we can use the formula
304302

305303
<div class="image-row">
306304
<figure>
@@ -359,6 +357,10 @@ <h4>Every 5th loop of iterative denoising</h4>
359357
<img src="images/ddpm/DDPM_4x5.png" alt="DDPM_4x5.png" />
360358
<figcaption>Step 20</figcaption>
361359
</figure>
360+
<figure>
361+
<img src="images/ddpm/final_ddpm.png" alt="DDPM_4x5.png" />
362+
<figcaption>Step 23 (final)</figcaption>
363+
</figure>
362364
</div>
363365

364366
<h4>Final predicted clean images</h4>
@@ -420,12 +422,15 @@ <h3>5 Sampled Images</h3>
420422
<section id="part-1-6">
421423
<h2>Part 1.6 – Classifier-Free Guidance (CFG)</h2>
422424

425+
To improve the quality of the images, we can compute both a noise estiamte conditioned on the text prompt, and the unconditional noise estimate, based on the null prompt <code>''</code>. Denoting the conditional noise estimate as &epsilon;<sub>c</sub> and the unconditional noise estimate as &epsilon;<sub>u</sub>, we let our noise estimate be &epsilon; = &epsilon;<sub>u</sub> + &gamma;(&epsilon;<sub>c</sub> - &epsilon;<sub>u</sub>). Note that we have &epsilon; = &epsilon;<sub>u</sub> and &epsilon; = &epsilon;<sub>c</sub> for &gamma; = 0 and &gamma; = 1 respectively. However, when &gamma; > 1, we can get much higher equality images for reasons still dicussed today. This technique is known as <strong>classifier-free guidance</strong>, and we can implement the noise estimate as follows:
426+
423427
<div class="subsection">
424-
<h3>Code: iterative_denoise_cfg</h3>
425428
<pre><code>noise_est_cfg = uncond_noise_est + scale * (noise_est - uncond_noise_est)
426429
</code></pre>
427430
</div>
428431

432+
Using &gamma; = 7 and the conditional & unconditional prompts be <code>'a high quality photo'</code> and the null prompt, we the following sample images:
433+
429434
<div class="subsection">
430435
<h3>5 Images with Prompt "a high quality photo" (γ = 7)</h3>
431436
<div class="image-row">

0 commit comments

Comments
 (0)