lululxvi / deepxde

A library for scientific machine learning and physics-informed learning
https://deepxde.readthedocs.io
GNU Lesser General Public License v2.1
2.61k stars 735 forks source link

About ''L-BFGS'' #536

Open SSongjinn opened 2 years ago

SSongjinn commented 2 years ago

Dear Dr. lulu,

I have some questions about DeepXDE. What are the criteria for LBFGS optimizing stop? Why are only a few dozen steps optimized after adam?

And I set the optimized parameters of LBFGS to make 'epochs' large like this dde.optimizers.config.set_LBFGS_options( maxcor=50, ftol=1.0 * np.finfo(float).eps, gtol=1e-8, maxiter=1000, maxfun=1000, maxls=50, ) But it doesn't work.

And another question is how to use LBFGS in tensorflow2.0 because the 'tf.contrib' is removed in tf1.0. Thank you in advance for your time!

lululxvi commented 2 years ago

See the "Warining" at https://deepxde.readthedocs.io/en/latest/modules/deepxde.optimizers.html#deepxde.optimizers.config.set_LBFGS_options

DeepXDE supports L-BFGS for all backends. Exactly the same usage.

elliot-hicks commented 1 year ago

@SSongjinn , I also had a 'tf.contrib' warning when moving to tensorflow 2 backend also, I was able to remedy this by upgrading my tensorflow-probability install. As stated in the docs, you need a version of tensorflow-probability>=0.10.0.

If your version is too old, use

pip install --upgrade tensorflow-probability.