@@ -21,23 +21,24 @@ def set_LBFGS_options(
2121 - TensorFlow 1.x: `scipy.optimize.minimize <https://docs.scipy.org/doc/scipy/reference/optimize.minimize-lbfgsb.html#optimize-minimize-lbfgsb>`_
2222 - TensorFlow 2.x: `tfp.optimizer.lbfgs_minimize <https://www.tensorflow.org/probability/api_docs/python/tfp/optimizer/lbfgs_minimize>`_
2323 - PyTorch: `torch.optim.LBFGS <https://pytorch.org/docs/stable/generated/torch.optim.LBFGS.html>`_
24+ - Paddle: `paddle.incubate.optimizers.LBFGS <https://www.paddlepaddle.org.cn/documentation/docs/en/develop/api/paddle/incubate/optimizer/LBFGS_en.html>`_
2425
2526 I find empirically that torch.optim.LBFGS and scipy.optimize.minimize are better than
2627 tfp.optimizer.lbfgs_minimize in terms of the final loss value.
2728
2829 Args:
29- maxcor (int): `maxcor` (scipy), `num_correction_pairs` (tfp), `history_size` (torch).
30+ maxcor (int): `maxcor` (scipy), `num_correction_pairs` (tfp), `history_size` (torch), `history_size` (paddle) .
3031 The maximum number of variable metric corrections used to define the limited
3132 memory matrix. (The limited memory BFGS method does not store the full
3233 hessian but uses this many terms in an approximation to it.)
33- ftol (float): `ftol` (scipy), `f_relative_tolerance` (tfp), `tolerance_change` (torch).
34+ ftol (float): `ftol` (scipy), `f_relative_tolerance` (tfp), `tolerance_change` (torch), `tolerance_change` (paddle) .
3435 The iteration stops when `(f^k - f^{k+1})/max{|f^k|,|f^{k+1}|,1} <= ftol`.
35- gtol (float): `gtol` (scipy), `tolerance` (tfp), `tolerance_grad` (torch).
36+ gtol (float): `gtol` (scipy), `tolerance` (tfp), `tolerance_grad` (torch), `tolerance_grad` (paddle) .
3637 The iteration will stop when `max{|proj g_i | i = 1, ..., n} <= gtol` where
3738 `pg_i` is the i-th component of the projected gradient.
38- maxiter (int): `maxiter` (scipy), `max_iterations` (tfp), `max_iter` (torch).
39+ maxiter (int): `maxiter` (scipy), `max_iterations` (tfp), `max_iter` (torch), `max_iter` (paddle) .
3940 Maximum number of iterations.
40- maxfun (int): `maxfun` (scipy), `max_eval` (torch).
41+ maxfun (int): `maxfun` (scipy), `max_eval` (torch), `max_eval` (paddle) .
4142 Maximum number of function evaluations. If ``None``, `maxiter` * 1.25.
4243 maxls (int): `maxls` (scipy), `max_line_search_iterations` (tfp).
4344 Maximum number of line search steps (per iteration).
@@ -62,7 +63,7 @@ def set_LBFGS_options(
6263
6364
6465# Backend-dependent options
65- if backend_name == "pytorch" :
66+ if backend_name in [ "pytorch" , "paddle" ] :
6667 # number of iterations per optimization call
6768 LBFGS_options ["iter_per_step" ] = min (1000 , LBFGS_options ["maxiter" ])
6869 LBFGS_options ["fun_per_step" ] = (
0 commit comments