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

output sample images are incorrectly normalized #7

Open
jcpeterson opened this issue Nov 27, 2017 · 6 comments
Open

output sample images are incorrectly normalized #7

jcpeterson opened this issue Nov 27, 2017 · 6 comments

Comments

@jcpeterson
Copy link

Some of the sample images looked washed out. I suspect that the min/max pixel values of the real samples versus the generated ones are different. It fluctuates wildly on every output. This makes it hard to verify quality during training most of the time.

@jcpeterson
Copy link
Author

Here's a quick hack to fix:

half = samples.shape[1] / 2
samples[:,:half,:] = samples[:,:half,:] - np.min(samples[:,:half,:])
samples[:,:half,:] = samples[:,:half,:] / np.max(samples[:,:half,:])
samples[:,half:,:] = samples[:,half:,:] - np.min(samples[:,half:,:])
samples[:,half:,:] = samples[:,half:,:] / np.max(samples[:,half:,:])

@jcpeterson
Copy link
Author

although I also removed the white spacing

@github-pengge
Copy link
Owner

Thx.

@jcpeterson
Copy link
Author

this doesn't seem to be fully working for some reason. not sure why

@github-pengge
Copy link
Owner

So do I. Cannot figure out why.

@jcpeterson
Copy link
Author

Something like this seems to remove outlier values and fix the problem:

half = samples.shape[1] / 2

sd_fake = np.std(samples[:,:half,:])
m_fake = np.mean(samples[:,:half,:])
margin = m_fake + (sd_fake*4)

samples[np.where(samples[:,:half,:] > margin)] = margin
samples[np.where(samples[:,:half,:] < -margin)] = -margin

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