Skip to content

Commit 9dc380f

Browse files
authored
Update proj5.html
1 parent 867eec7 commit 9dc380f

File tree

1 file changed

+48
-3
lines changed

1 file changed

+48
-3
lines changed

project-5/proj5.html

Lines changed: 48 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -919,9 +919,9 @@ <h2>Part 1.9 – Hybrid Images</h2>
919919
</section>
920920

921921
<!-- ========================================================= -->
922-
<!-- Part 2.0: Flow Matching from Scratch -->
922+
<!-- Part 2: Flow Matching from Scratch -->
923923
<!-- ========================================================= -->
924-
<section id="part-2-1">
924+
<section id="part-2">
925925
<h2>Part 2 – Implementing the UNet from scratch</h2>
926926

927927
Now that we know how we can generate images with the help of a UNet in a denoising model, we will go through implementing one from scratch. More specifically, we will be attempting to generate digits similar to those in the MNIST dataset from pure noise using a denoising UNet that we will create.
@@ -932,7 +932,7 @@ <h3>Training an Unconditioned UNet</h3>
932932

933933
<br>To create a noisy image, we can use the process z = x + &sigma;&epsilon; where &sigma; &isin; [0, 1] and &epsilon; ~ &Nscr;(0, &#119816;). Here, &Nscr; is the standard normal distribution. To visualize the kind of images this process will result in, below is an example of an MNIST digit with progressively more noise as &sigma; gradually increases from 0 to 1:
934934

935-
<div class="image-row">
935+
<div align="center">
936936
<figure>
937937
<img src="images/unet/00.png" alt="00.png" />
938938
<figcaption>&sigma; = 0.0</figcaption>
@@ -1052,7 +1052,52 @@ <h4>Forward and Sampling Operations</h4>
10521052
</div>
10531053

10541054
Although the results are not perfect, the improvements starting from the 1st epoch up to the 10th are already noticeable.
1055+
1056+
<h4>Adding Class-Conditioning to Time-Conditioned UNet</h4>
1057+
To make more improvements to our image generation, we can condition our UNet on the class of digits 0-9. This require adding an additional FCBlock for each time condition, where the class vector <code>c</code> is a one-hot vector.
1058+
1059+
<h4>Class-Conditioned Forward and Sampling Operations</h4>
10551060
</section>
10561061

1062+
<!-- ========================================================= -->
1063+
<!-- Part 3: Appendix -->
1064+
<!-- ========================================================= -->
1065+
<section id="part-2">
1066+
<h2>Part 3 – Appendix</h2>
1067+
The standard UNet operations are defined as follows:
1068+
<div align="center">
1069+
<figure>
1070+
<img src="images/unet/standard_op.png" alt="standard_op.png" />
1071+
<figcaption>Source: <a href="https://cal-cs180.github.io/fa25/hw/proj5/partb.html">CS180</a></figcaption>
1072+
</figure>
1073+
</div>
1074+
1075+
where
1076+
<ul>
1077+
<li><strong>Conv2d(kernel_size, stride, padding)</strong> is <code>nn.Conv2d()</code>;</li>
1078+
<li><strong>BN</strong> is <code>nn.BatchNorm2d()</code>;</li>
1079+
<li><strong>GELU</strong> is <code>nn.GELU()</code>;</li>
1080+
<li><strong>ConvTranspose2d(kernel_size, stride, padding)</strong> is <code>nn.ConvTranspose2d()</code>;</li>
1081+
<li><strong>AvgPool(kernel_size)</strong> is <code>nn.AvgPool2d()</code>;</li>
1082+
<li><strong>+</strong> represents function composition, e.g. <code>f</code> + <code>g</code> = <code>f</code>(<code>g</code>(<code>x</code>)).</li>
1083+
</ul>
1084+
1085+
The <strong>FCBlock</strong> operation is defined as follows:
1086+
<div align="center">
1087+
<figure>
1088+
<img src="images/unet/fcblock_op.png" alt="fcblock_op.png" />
1089+
<figcaption>Source: <a href="https://cal-cs180.github.io/fa25/hw/proj5/partb.html">CS180</a></figcaption>
1090+
</figure>
1091+
</div>
1092+
1093+
where <strong>Linear</strong> is <code>nn.Linear()</code>.
1094+
</section>
1095+
1096+
<div align="center">
1097+
<p>
1098+
<a href="https://cjxthecoder.github.io">cjxthecoder</a> | <a href="https://github.com/cjxthecoder">GitHub</a> | <a href="https://www.linkedin.com/in/daniel-cheng-71b475279">LinkedIn</a>
1099+
</p>
1100+
</div>
1101+
10571102
</body>
10581103
</html>

0 commit comments

Comments
 (0)