Ben-Louis / Deep-Image-Analogy-PyTorch

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

Adam vs lbfgs #1

Open natew opened 6 years ago

natew commented 6 years ago

Hey, just got this running. My test case is:

image

to:

image

Using weight 2. Testing with weight 3 now. A couple questions for you as I'm relatively new to ML.

I notice that Harvey Slash made some modifications, moving to adam optimizer for example. Is there a reason you stuck with lbfgs? Would it be worth attempting a few of his changes?

This is very fun, thanks for releasing it. Any tips are much appreciated.

natew commented 6 years ago

While I'm here, thoughts on difficulty of doing multi-gpu?

Ben-Louis commented 6 years ago

Hi, thanks for testing the code on your images. Your task is a style-to-style transfer and the weight should be set to 3 according to official code. Also, the resize_ratio has to be 1 since details (such as facial features) are small in these two images. As for the optimizer, I select LBFGS because I found it performs better than Adam on several demo images. But I did not conduct comprehensive comparison between Adam and LBFGS. LBFGS is also adopted in similar works such as Deep-Neural-Transfer. I guess the reason Harvey Slash found Adam works better might be that the LBFGS optimizer of Pytorch (released version) does not support line search. Sorry I don't get your idea about multi-gpu. Memory the network takes is less than 2G, so I think one gpu works fine generally. If you mean using multi gpu to accelerate the deconvolution process, it will be appreciated if you implement this feature. I am not familiar with it and will not try it recently. Sorry about that. Could you pls share the links of two source images? I will test on them in these days

natew commented 6 years ago

Hey Ben, thanks for the reply! I got the original Caffe version running. It takes about 30 seconds vs about 2 hours for this version, so I was pretty surprised.

The results are similar enough. Some minor differences. I'm not seeing as good of results on my couple tests as are in the paper.

My multi-gpu question was essentially to test higher resolution. I see it's capped at 700px or so. I'd love to run it on much higher and see if that helps with quality in some cases. But I'm just a layperson here and likely wasting your time!

Attaching two sets of images I tried:

test.zip