Skip to content

Commit

Permalink
Fixed sample method of the model
Browse files Browse the repository at this point in the history
  • Loading branch information
anordertoreclaim committed Aug 4, 2019
1 parent 03d5598 commit 0224738
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pixelcnn/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def sample(self, shape, count, device='cuda'):
for c in range(channels):
unnormalized_probs = self.forward(samples)
pixel_probs = torch.softmax(unnormalized_probs[:, :, c, i, j], dim=1)
sampled_levels = torch.multinomial(pixel_probs, 1).squeeze()
sampled_levels = torch.multinomial(pixel_probs, 1).squeeze() / (self.color_levels - 1)
samples[:, c, i, j] = sampled_levels

return samples

0 comments on commit 0224738

Please sign in to comment.