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

Curious about the constant used in the normalize function #22

Open
daeilkim opened this issue Aug 14, 2017 · 3 comments
Open

Curious about the constant used in the normalize function #22

daeilkim opened this issue Aug 14, 2017 · 3 comments

Comments

@daeilkim
Copy link

In layers.py, there is a normalize function that has a constant of 127.5:

def normalize(layer):
return layer/127.5 - 1.

I'm a little confused as to where the 127.5 comes from. It's a very specific question of course, but i'm interested in extending the regularization loss function with other types of transforms outside of the identity mapping used in the paper. If you have any tips or pointers in modifying that I'd love to hear. Great work and thanks for doing this!

@alex-mocanu
Copy link
Contributor

It looks like the purpose of this normalization is to bring the values in range [-1.0,1.0]. As values for a pixel in grayscale are in range [0,255], we needed to divide by 127.5, to bring 255 to 2.0.

@daeilkim
Copy link
Author

So in the code's current form, would it not support RGB images?

@alex-mocanu
Copy link
Contributor

alex-mocanu commented Aug 17, 2017

Looking over the code, I could tell that it admits images with however many channels (only GPU memory limits you). You have to set the "input_channel" command line parameter to 3 and you should change the output layer of the refiner to output "self.input_channel" channels instead of 1.

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