Skip to content

Commit

Permalink
Modify to enable sampling
Browse files Browse the repository at this point in the history
  • Loading branch information
rosinality committed Jun 11, 2019
1 parent 494ff85 commit 70018bc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions pixelsnail.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ def forward(self, input, condition=None):
condition = F.one_hot(condition, self.n_class).permute(0, 3, 1, 2).float()
condition = self.cond_resnet(condition)
condition = F.interpolate(condition, scale_factor=2)
condition = condition[:, :, :height, :]

for block in self.blocks:
out = block(out, background, condition=condition)
Expand Down
2 changes: 2 additions & 0 deletions vqvae.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,9 @@ def decode(self, quant_t, quant_b):

def decode_code(self, code_t, code_b):
quant_t = self.quantize_t.embed_code(code_t)
quant_t = quant_t.permute(0, 3, 1, 2)
quant_b = self.quantize_b.embed_code(code_b)
quant_b = quant_b.permute(0, 3, 1, 2)

dec = self.decode(quant_t, quant_b)

Expand Down

0 comments on commit 70018bc

Please sign in to comment.