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

Implementing layer-level normalization of gradients similar to neural_artistic_style? #326

Closed
ProGamerGov opened this issue Sep 19, 2016 · 3 comments

Comments

@ProGamerGov
Copy link

ProGamerGov commented Sep 19, 2016

When people are discussing style transfer projects, I have seen people mention that the "weird muddy areas" they see on artwork produced by Neural-Style, are an issue which can be solved. Is this something that is possible for Neural-Style, seeing as Neural_Artistic_Style already solved this problem? How serious is this issue with Neural-Style?

The gradient normalization on neural_artistic_style being discussed in more detail: andersbll/neural_artistic_style#39 (comment)

Regarding the visual style, I perform layer-level normalization of gradients. In the VGG-net, the features in each layer may exist on different scales. By L1-normalizing the gradient signals, I get a more even contribution across the different layers. I suspect this is the secret sauce. :)

@ProGamerGov ProGamerGov changed the title Implementing gradient normalization similar to neural_artistic_style? Implementing layer-level normalization of gradients similar to neural_artistic_style? Sep 19, 2016
@jcjohnson
Copy link
Owner

L1 normalization of gradients coming from content or style losses has been in neural-style for a long time; you can just add the flag -normalize_gradients.

@htoyryla
Copy link

Neural_artistic_style also seems to use scaling of gram matrices to
compensate for different sizes of content and style images. If I
understood the code correctly, it does not scale the size of the matrix,
but only the values in the matrix. I might give this a try as I have
already experimented with variations of the gram matrix. But this is not
likely to have a major impact on quality; to me it seems more like an
automatic adjustment of style weights depending on the image sizes.

@MrZoidberg
Copy link

MrZoidberg commented Dec 15, 2016

@jcjohnson is there any samples of using -normalize_gradients with the commands? I'm getting just weird results with the following command:

th neural_style.lua -style_image $HOME/sync/styles/style7.jpg -content_image $HOME/sync/iteration1/selfie2.jpg -output_image $HOME/sync/style7_sw150_sc15_norm.jpg -image_size 600 -backend cudnn -normalize_gradients

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

4 participants