ProGamerGov / neural-style-pt

PyTorch implementation of neural style transfer algorithm
MIT License
838 stars 175 forks source link

Missing -normalize_gradient parameter #43

Closed qwerdbeta closed 4 years ago

qwerdbeta commented 4 years ago

Hi, I noticed this is based on the jcjohnson code, but his has a param called -normalize_gradient tat is iplemented on lines 130-149 ish on https://github.com/jcjohnson/neural-style/blob/master/neural_style.lua

Would you consider porting his lua code of this feature and perhaps other normalization approaches?

Thanks!

ProGamerGov commented 4 years ago

@qwerdbeta I've tried many times, but thus far I am unable to get neural-style's gradient normalization feature working in neural-style-pt: https://github.com/ProGamerGov/neural-style-pt/issues/26#issuecomment-538415828

If you have any suggestions for other normalization approaches, please share them!

ProGamerGov commented 4 years ago

I'm currently testing a weight normalization feature at: https://github.com/ProGamerGov/neural-style-pt/tree/stylized-imagenet, but I'm still not sure if the feature improves results yet.

Edit:

The feature has been added to the main code: https://github.com/ProGamerGov/neural-style-pt/pull/42

ProGamerGov commented 4 years ago

You can get somewhat similar results to neural-style's -normalize_gradients parameter, if you set the content weight value to 0 with: -content_weight 0.

ProGamerGov commented 4 years ago

I'm going to close this issue for the moment. If someone manages to make progress on getting gradient normalization working, then we can reopen this issue or make a new one.

ProGamerGov commented 3 years ago

@qwerdbeta I finally figure out how to recreate the -normalize_gradients parameter in PyTorch, and I've added it to neural-style-pt!