Closed RohollahHS closed 1 month ago
Hello,
The second "+1" is used for masking the class tokens for the classifier-free guidance. When the condition is dropped, it defaults to the last value of the embedding layer.
This was primarily for an internal experiment I conducted. It allows the model to also predict the
Best,
Victor
Hi. Thanks for the great work. I have two questions.
Can you please clarify what the second
1
is used for?codebook_size
is1024
, so its indices are between[0, 1023]
. The first1
in the code is for the mask token, which is1024
.nclass
is1000
for ImageNet. I do not understand the purpose of increasing thenn.Embedding
with another1
. Link to codeIn the following code, why is
self.codebook_size+1
used instead ofself.codebook_size
? What is the purpose of the additional token when after that we compute the cross-entropy loss? Link to code