Skip to content

Commit

Permalink
improve introduction of bfgs args (#42191)
Browse files Browse the repository at this point in the history
* improve introduction of bfgs args; test=document_fix

* modify according to zhouwei's comment; test=document_fix
  • Loading branch information
betterpig committed May 10, 2022
1 parent cf198dc commit 000edfd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions python/paddle/incubate/optimizer/functional/bfgs.py
Expand Up @@ -49,16 +49,16 @@ def minimize_bfgs(objective_func,
Jorge Nocedal, Stephen J. Wright, Numerical Optimization, Second Edition, 2006. pp140: Algorithm 6.1 (BFGS Method).
Args:
objective_func: the objective function to minimize. ``objective_func`` accepts a multivariate input and returns a scalar.
initial_position (Tensor): the starting point of the iterates.
objective_func: the objective function to minimize. ``objective_func`` accepts a 1D Tensor and returns a scalar.
initial_position (Tensor): the starting point of the iterates, has the same shape with the input of ``objective_func`` .
max_iters (int, optional): the maximum number of minimization iterations. Default value: 50.
tolerance_grad (float, optional): terminates if the gradient norm is smaller than this. Currently gradient norm uses inf norm. Default value: 1e-7.
tolerance_change (float, optional): terminates if the change of function value/position/parameter between two iterations is smaller than this value. Default value: 1e-9.
initial_inverse_hessian_estimate (Tensor, optional): the initial inverse hessian approximation at initial_position. It must be symmetric and positive definite. Default value: None.
initial_inverse_hessian_estimate (Tensor, optional): the initial inverse hessian approximation at initial_position. It must be symmetric and positive definite. If not given, will use an identity matrix of order N, which is size of ``initial_position`` . Default value: None.
line_search_fn (str, optional): indicate which line search method to use, only support 'strong wolfe' right now. May support 'Hager Zhang' in the futrue. Default value: 'strong wolfe'.
max_line_search_iters (int, optional): the maximum number of line search iterations. Default value: 50.
initial_step_length (float, optional): step length used in first iteration of line search. different initial_step_length may cause different optimal result. For methods like Newton and quasi-Newton the initial trial step length should always be 1.0. Default value: 1.0.
dtype ('float32' | 'float64', optional): data type used in the algorithm. Default value: 'float32'.
dtype ('float32' | 'float64', optional): data type used in the algorithm, the data type of the input parameter must be consistent with the dtype. Default value: 'float32'.
name (str, optional): Name for the operation. For more information, please refer to :ref:`api_guide_Name`. Default value: None.
Returns:
Expand Down
8 changes: 4 additions & 4 deletions python/paddle/incubate/optimizer/functional/lbfgs.py
Expand Up @@ -50,17 +50,17 @@ def minimize_lbfgs(objective_func,
Jorge Nocedal, Stephen J. Wright, Numerical Optimization, Second Edition, 2006. pp179: Algorithm 7.5 (L-BFGS).
Args:
objective_func: the objective function to minimize. ``objective_func`` accepts a multivariate input and returns a scalar.
initial_position (Tensor): the starting point of the iterates.
objective_func: the objective function to minimize. ``objective_func`` accepts a 1D Tensor and returns a scalar.
initial_position (Tensor): the starting point of the iterates, has the same shape with the input of ``objective_func`` .
history_size (Scalar): the number of stored vector pairs {si,yi}. Default value: 100.
max_iters (int, optional): the maximum number of minimization iterations. Default value: 50.
tolerance_grad (float, optional): terminates if the gradient norm is smaller than this. Currently gradient norm uses inf norm. Default value: 1e-7.
tolerance_change (float, optional): terminates if the change of function value/position/parameter between two iterations is smaller than this value. Default value: 1e-9.
initial_inverse_hessian_estimate (Tensor, optional): the initial inverse hessian approximation at initial_position. It must be symmetric and positive definite. Default value: None.
initial_inverse_hessian_estimate (Tensor, optional): the initial inverse hessian approximation at initial_position. It must be symmetric and positive definite. If not given, will use an identity matrix of order N, which is size of ``initial_position`` . Default value: None.
line_search_fn (str, optional): indicate which line search method to use, only support 'strong wolfe' right now. May support 'Hager Zhang' in the futrue. Default value: 'strong wolfe'.
max_line_search_iters (int, optional): the maximum number of line search iterations. Default value: 50.
initial_step_length (float, optional): step length used in first iteration of line search. different initial_step_length may cause different optimal result. For methods like Newton and quasi-Newton the initial trial step length should always be 1.0. Default value: 1.0.
dtype ('float32' | 'float64', optional): data type used in the algorithm. Default value: 'float32'.
dtype ('float32' | 'float64', optional): data type used in the algorithm, the data type of the input parameter must be consistent with the dtype. Default value: 'float32'.
name (str, optional): Name for the operation. For more information, please refer to :ref:`api_guide_Name`. Default value: None.
Returns:
Expand Down

0 comments on commit 000edfd

Please sign in to comment.