mirror of
https://github.com/lucidrains/DALLE2-pytorch.git
synced 2026-02-20 17:34:24 +01:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cb26187450 | ||
|
|
625ce23f6b |
@@ -743,7 +743,7 @@ class DiffusionPrior(BaseGaussianDiffusion):
|
|||||||
text_cond = dict(text_embed = text_embed)
|
text_cond = dict(text_embed = text_embed)
|
||||||
|
|
||||||
if self.condition_on_text_encodings:
|
if self.condition_on_text_encodings:
|
||||||
text_cond = {**text_cond, 'text_encodings': text_encodings, 'mask': text_mask}
|
text_cond = {**text_cond, 'text_encodings': text_encodings, 'mask': text != 0}
|
||||||
|
|
||||||
image_embeds = self.p_sample_loop((batch_size, image_embed_dim), text_cond = text_cond)
|
image_embeds = self.p_sample_loop((batch_size, image_embed_dim), text_cond = text_cond)
|
||||||
text_embeds = text_cond['text_embed']
|
text_embeds = text_cond['text_embed']
|
||||||
|
|||||||
@@ -545,6 +545,7 @@ class VQGanVAE(nn.Module):
|
|||||||
l2_recon_loss = False,
|
l2_recon_loss = False,
|
||||||
use_hinge_loss = True,
|
use_hinge_loss = True,
|
||||||
vgg = None,
|
vgg = None,
|
||||||
|
vq_codebook_dim = 256,
|
||||||
vq_codebook_size = 512,
|
vq_codebook_size = 512,
|
||||||
vq_decay = 0.8,
|
vq_decay = 0.8,
|
||||||
vq_commitment_weight = 1.,
|
vq_commitment_weight = 1.,
|
||||||
@@ -579,6 +580,7 @@ class VQGanVAE(nn.Module):
|
|||||||
|
|
||||||
self.vq = VQ(
|
self.vq = VQ(
|
||||||
dim = self.enc_dec.encoded_dim,
|
dim = self.enc_dec.encoded_dim,
|
||||||
|
codebook_dim = vq_codebook_dim,
|
||||||
codebook_size = vq_codebook_size,
|
codebook_size = vq_codebook_size,
|
||||||
decay = vq_decay,
|
decay = vq_decay,
|
||||||
commitment_weight = vq_commitment_weight,
|
commitment_weight = vq_commitment_weight,
|
||||||
|
|||||||
Reference in New Issue
Block a user