Ben-Louis / Deep-Image-Analogy-PyTorch

A python implementation of Deep-Image-Analogy based on pytorch.
MIT License
182 stars 42 forks source link

Differences from my implementation #3

Open harveyslash opened 6 years ago

harveyslash commented 6 years ago

Hi,

I maintain my own version https://github.com/Ben-Louis/Deep-Image-Analogy-PyTorch of this paper, but I was unable to get results close to the paper.

However, your results match almost perfectly. Could you tell me if there is anything different that I am doing, or I should try out ?

Ben-Louis commented 6 years ago

Sorry I am busy these days so I cannot explain in detail. The two main differences are:

  1. Deconvolution process: I follow the guide of this issue and deconvolute the feature on one layer (e.g. L4) to the second last layer (e.g. L2) and forward it to the last layer (e.g. L3). Also, I modify the lbfgs algorithm provided by pytorch to make it support line search.

  2. Patchmatch: compared to your initial version of patchmatch, where algorithm search for two directions per iteration, this patchmatch algorithm search for four directions in one iteration. But if you use the wrapped official cuda version of patchmatch, there seems no difference.

I appreciate your implementation very much. It helps me a lot in this project!

harveyslash commented 6 years ago

i also noticed that you are performing patch averaging in each step. Is this done in the paper too?

Also, did you try using sigmoid function instead of the indicator function ? (the author said that he used indicator just as a fast approximation to sigmoid)

qhanson commented 6 years ago

@harveyslash Another difference is that the distance_caculate in your GPU version is different from this repository and the official version. To be more detail, the distance is negative when the number of the channel of the pixel feature is not 3. The results are different with different implementations.