pystiche / papers

Reference implementation and replication of prominent NST papers
BSD 3-Clause "New" or "Revised" License
4 stars 1 forks source link

Improvement ulyanov_et_al_2016 #248

Closed jbueltemeier closed 2 years ago

jbueltemeier commented 3 years ago

So far, this implementation has not produced good results. This was because in the reference implementation the backward pass of the gradient is normalized and this is missing in this implementation. The results are now better, but still with measures, probably due to different hyperparameter that are too high or too low. Therefore, similar results as in the paper can now be created if the style_weight is changed.

Therefore in the following two points which should be discussed in advance:

  1. Due to the changed hyperparameter setting from #244 it is now easier to adjust the hyperparameter. Therefore i would adjust the style_weight for this replication so that besides the results with the default parameters similar results to the paper are created.

  2. One problem with the replication of the master branch is that the images are too small and have to be enlarged for training. I currently added an additional resize in the content_image_transform before the ValidRandomCrop, but this is not implemented in the reference implementation.

codecov[bot] commented 3 years ago

Codecov Report

Merging #248 (432ad21) into master (7ba28c6) will decrease coverage by 0.5%. The diff coverage is 86.5%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master    #248     +/-   ##
========================================
- Coverage    98.6%   98.1%   -0.6%     
========================================
  Files          39      39             
  Lines        1558    1610     +52     
========================================
+ Hits         1537    1580     +43     
- Misses         21      30      +9     
Impacted Files Coverage Δ
pystiche_papers/ulyanov_et_al_2016/_utils.py 100.0% <ø> (ø)
pystiche_papers/ulyanov_et_al_2016/_loss.py 91.5% <83.6%> (-8.5%) :arrow_down:
pystiche_papers/ulyanov_et_al_2016/_data.py 100.0% <100.0%> (ø)
pystiche_papers/ulyanov_et_al_2016/_modules.py 100.0% <100.0%> (ø)
pystiche_papers/ulyanov_et_al_2016/_nst.py 95.4% <100.0%> (+0.1%) :arrow_up:
pystiche_papers/li_wand_2016/_utils.py 96.1% <0.0%> (ø)
pystiche_papers/gatys_et_al_2017/_utils.py 100.0% <0.0%> (ø)
pystiche_papers/gatys_ecker_bethge_2016/_utils.py 100.0% <0.0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 7ba28c6...432ad21. Read the comment docs.

jbueltemeier commented 2 years ago

This PR has been divided into several smaller PRs: #250 Manipulate gradients in ulyanov_et_al_2016 #251 Change Ulyanov stylization pretransformation #252 Remove unused texture images in ulyanov_et_al_2016 #253 Add missing permalinks in ulyanov_et_al_2016

The handling of the image pre-processing of the content images has still been left open. This currently leads to a failure of the training. This will be addressed in a new PR.