Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What are the values in the normalized x and y coordinates in SVHN -> MNIST model? #39

Closed
hsm207 opened this issue Jan 12, 2018 · 1 comment

Comments

@hsm207
Copy link
Contributor

hsm207 commented Jan 12, 2018

In Appendix B, in the paragraph about SVHN -> MNIST, it is written:

For each input image, we created a 5-channel variant where the first three channels were the original RGB images and the last two channels were the normalized x and y coordinates.

It seems to me that this is implement in cocogan_trainer_da.py:

  def _create_xy_image(self, width=32):
    coordinates = list(itertools.product(range(width), range(width)))
    arr = (np.reshape(np.asarray(coordinates), newshape=[width, width, 2]) - width/2 ) / (width/2)
    new_map = np.transpose(np.float32(arr), [2, 0, 1])
    xy = Variable(torch.from_numpy(new_map), requires_grad=False)
    return xy

The way the code is written, the contents of xy is just -1 or 0 because the environment is Python 2. Did you mean to do this? I thought the values should be between -1 and 1.

@mingyuliutw
Copy link
Owner

Thanks for reporting. This is a bug. The xy image should be in [-1 1]. I have pushed the update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants