neural-style icon indicating copy to clipboard operation
neural-style copied to clipboard

comparing two optimizer, adam, lbfgs

Open Henry-Yan-HS opened this issue 9 years ago • 6 comments

Any insights on the performance/ pros, cons of two optimizers:

Can someone give a brief explanation of how both works, what are their respective advantages and disadvantages, and how they performed?

Thanks!

Henry-Yan-HS avatar Sep 25 '16 05:09 Henry-Yan-HS

a short example is that adam could do larger images at the cost of quality, lbfgs is considered better at generating art, but is limited is resolution because of the high GPU memory footprint.

darkstorm2150 avatar Sep 26 '16 14:09 darkstorm2150

Adam can be useful when using multires or similar scripts that slowly step up the output image size. When Adam has an example init-image from lbfgs the aesthetic is more or less maintained. So, you would step up to your max allowable resolution under lbfgs and then continue with Adam beyond that.

cablecutter avatar Jan 06 '17 15:01 cablecutter

@vic8760 I used the adam to calculate the iamge, actually the quality is lower than that with L-BFGS. The quality of transfered image is coarser.

linrio avatar Apr 18 '17 04:04 linrio

@cablecutter What's the mean of

... When Adam has an example init-image from lbfgs the aesthetic is more or less maintained ... ?

linrio avatar Apr 18 '17 04:04 linrio

The Adam optimizer can be greatly improved in Neural-Style by simply changing it's default parameters to more "stable" values according to my research here: https://github.com/jcjohnson/neural-style/wiki/Fine-Tuning-The-Adam-Optimizer

With the improved parameter values, Adam become a lot closer to L-BFGS in terms of quality.

Another trick you can do to improve quality when using multiscale scale resolution, is to use L-BFGS for the lower image size steps (where most of the major changes occur), and then use Adam for the subsequent larger image size steps.

ProGamerGov avatar Feb 23 '18 01:02 ProGamerGov

Hi, I was wondering if anyone could help me with code for replacing lbfgs with Adam. I would be happy because I want to study effects of different losses.

nile649 avatar Mar 31 '18 04:03 nile649