You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: project-5/proj5.html
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1059,14 +1059,14 @@ <h4>Time-Conditioned Forward and Sampling Operations</h4>
1059
1059
Although the results are not perfect, the improvements starting from the 1st epoch up to the 10th are already noticeable.
1060
1060
1061
1061
<h4>Adding Class-Conditioning to Time-Conditioned UNet</h4>
1062
-
To make more improvements to our image generation, we can condition our UNet on the class of digits 0-9. This requires adding an additional FCBlock for each time condition, where the class vector <code>c</code>is a one-hot vector. To ensure that the UNet would still work without conditioning on the class (in order to implement CFG later), we will set a dropout rate <code>p<sub>uncond</sub></code> of 0.1, in which we set the one-hot vector of <code>c</code> to all 0s.
1062
+
To make more improvements to our image generation, we can condition our UNet on the class of digits 0-9. This requires adding an additional FCBlock for the <code>unflat</code> and <code>firstUpBlock</code> tensor, where we convert the class vector <code>c</code>into a one-hot vector before passing it through FCBlock. To ensure that the UNet would still work without conditioning on the class (in order to implement CFG later), we will set a dropout rate <code>p<sub>uncond</sub></code> of 0.1, in which we set the one-hot vector of <code>c</code> to all 0s.
1063
1063
1064
1064
<h4>Embedding <code>c</code> and <code>t</code> in the UNet</h4>
1065
1065
To embed <code>c</code><code>t</code> in the UNet, we will use 2 additional FCBlocks to convert the label (<code>c</code>) into 2 tensors <code>fc1_c</code> and <code>fc2_c</code>, each with the same number of hidden dimensions as <code>fc1_t</code> and <code>fc2_t</code> respectively. Then, instead of multiplying the intermediate blocks by the time tensor, we will instead do:
The last step is to zero out the class one-hot vectors at the dropout rate, which we can implement efficiently by using a mask of the same length as the batch size. We can then multiply the batch of one-hot vectors with it to zero out any vector that is the <code>i</code>-th in the batch if <code>mask[i] = 0</code>.
1069
+
The last step is to zero out the class one-hot vectors at the dropout rate, which we can implement efficiently by using a mask of the same length as the batch size. We can then multiply the batch of one-hot vectors by the mask to zero out any vector that is the <code>i</code>-th in the batch if <code>mask[i] = 0</code>.
1070
1070
1071
1071
<h4>Class Conditioning Hyperparameters</h4>
1072
1072
Because class conditioning converges fast, we will use the same number of training epochs as time conditioning, which is 10. A guidance scale of γ = 5 will be used in the CFG part. The same hyperparameters as the Time-Conditioned UNet will be used for the relevant parts.
0 commit comments