Skip to content

Commit

Permalink
Remove rebuttal comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ajayjain committed Apr 25, 2020
1 parent 95d457e commit 4bf42e1
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
8 changes: 0 additions & 8 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,9 @@ def random_resize_collate(batch, default_collate=torch.utils.data.dataloader.def
assert args.n_bits == 8
if args.binarize:
rescaling = lambda x : (binarize_torch(x) - .5) * 2. # binarze and rescale [0, 1] images into [-1, 1] range
#rescaling = lambda x : binarize_torch(x).float() # binarze [0, 1] images NOTE: temporary for rebuttal
else:
rescaling = lambda x : (x - .5) * 2. # rescale [0, 1] images into [-1, 1] range
rescaling_inv = lambda x : .5 * x + .5
#rescaling_inv = lambda x : x # NOTE: temporary for rebuttal
ds_transforms = transforms.Compose([transforms.ToTensor(), rescaling])

train_loader = torch.utils.data.DataLoader(datasets.MNIST(args.data_dir, download=True,
Expand Down Expand Up @@ -278,12 +276,6 @@ def rescaling(x):
x = (2. / (n_bins - 1)) * x - 1.
return x
rescaling_inv = lambda x : .5 * x + .5 # rescale [-1, 1] range to [0, 1] range
#def rescaling_inv(x):
# # rescale images from [-1, 1] to [0, n_bins-1]
# x = ((n_bins - 1) / 2) * (x + 1.)
# # increase bit depth to [0, 255] range
# x = x * depth_divisor
# return x

# NOTE: Random resizing of images during training is not supported for CelebA-HQ. Will use 256x256 resolution.
def get_celeba_dataloaders():
Expand Down
2 changes: 0 additions & 2 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,6 @@ def discretized_mix_logistic_loss_1d_averaged(x, ls):

def _binarized_label(x):
assert x.size(1) == 1
# NOTE: temporarily disabled for rebuttal, checking [0, 1] images + mask conditioning
x = x * .5 + .5 # Scale from [-1, 1] to [0, 1] range
x = binarize_torch(x) # binarize image. Should be able to just cast,
# since x is either 0. or 1., but this could avoid float
Expand Down Expand Up @@ -503,7 +502,6 @@ def sample_from_binary_logits(l, coord1, coord2):
assert l.size(1) == 2
l = l[:, :, coord1, coord2]
pixels = torch.distributions.categorical.Categorical(logits=l).sample()
# NOTE: Disabled for {0, 1} input rebuttal experiments
pixels = pixels * 2. - 1.
return pixels.unsqueeze(1)

Expand Down

0 comments on commit 4bf42e1

Please sign in to comment.