From 341c8fce7287b0287989fba0c154e63a1b779629 Mon Sep 17 00:00:00 2001 From: Jing Lin <82669431+linjing-lab@users.noreply.github.com> Date: Thu, 19 Oct 2023 23:03:29 +0800 Subject: [PATCH] update optimtool --- optimtool/constrain/equal.py | 6 +++--- optimtool/constrain/mixequal.py | 12 ++++++------ optimtool/constrain/unequal.py | 8 ++++---- optimtool/example/Lasso.py | 2 +- optimtool/unconstrain/gradient_descent.py | 2 +- optimtool/unconstrain/nonlinear_least_square.py | 2 +- optimtool/unconstrain/trust_region.py | 4 ++-- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/optimtool/constrain/equal.py b/optimtool/constrain/equal.py index 68c79ca..da4e2cf 100644 --- a/optimtool/constrain/equal.py +++ b/optimtool/constrain/equal.py @@ -103,9 +103,9 @@ def lagrange_augmentede(funcs: FuncArray, :param draw: bool, use `bool` to control whether to draw visual images. default: bool=True. :param output_f: bool, use `bool` to control whether to obtain iterative values of `funcs`. default: bool=False. :param method: str, unconstrained kernel used to drive the operation of finding the point of intermediate function. default: str='newton'. - :param lamk: float, the initial value of the elements in the initial penalty vector. default: float=6. - :param sigma: float, penalty factor used to set the degree of convergence of `funcs`. default: float=10. - :param p: float, parameter to adjust the degree value of convergence named `sigma`. default: float=2. + :param lamk: float, the initial value of the elements in the initial penalty vector. default: float=6.0. + :param sigma: float, penalty factor used to set the degree of convergence of `funcs`. default: float=10.0. + :param p: float, parameter to adjust the degree value of convergence named `sigma`. default: float=2.0. :param epak: float, used to set the precision to accelerate the completion of kernel. default: float=1e-4. :param epsilon: float, used to set the precision of stopping the overall algorithm. default: float=1e-6. :param k: int, iterative times is used to measure the difficulty of learning the `funcs` in the algorithm. default: int=0. diff --git a/optimtool/constrain/mixequal.py b/optimtool/constrain/mixequal.py index f88503f..3c4ec24 100644 --- a/optimtool/constrain/mixequal.py +++ b/optimtool/constrain/mixequal.py @@ -50,7 +50,7 @@ def penalty_quadraticm(funcs: FuncArray, :param draw: bool, use `bool` to control whether to draw visual images. default: bool=True. :param output_f: bool, use `bool` to control whether to obtain iterative values of `funcs`. default: bool=False. :param method: str, unconstrained kernel used to drive the operation of finding the point of intermediate function. default: str='newton'. - :param sigma: float, penalty factor used to set the degree of convergence of `funcs`. default: float=10. + :param sigma: float, penalty factor used to set the degree of convergence of `funcs`. default: float=10.0. :param p: float, parameter to adjust the degree value of convergence named `sigma`. default: float=0.6. :param epsk: float, used to set the precision to accelerate the completion of kernel. default: float=1e-6. :param epsilon: float, used to set the precision of stopping the overall algorithm. default: float=1e-10. @@ -109,7 +109,7 @@ def penalty_L1(funcs: FuncArray, :param draw: bool, use `bool` to control whether to draw visual images. default: bool=True. :param output_f: bool, use `bool` to control whether to obtain iterative values of `funcs`. default: bool=False. :param method: str, unconstrained kernel used to drive the operation of finding the point of intermediate function. default: str='newton'. - :param sigma: float, penalty factor used to set the degree of convergence of `funcs`. default: float=1. + :param sigma: float, penalty factor used to set the degree of convergence of `funcs`. default: float=1.0. :param p: float, parameter to adjust the degree value of convergence named `sigma`. default: float=0.6. :param epsk: float, used to set the precision to accelerate the completion of kernel. default: float=1e-6. :param epsilon: float, used to set the precision of stopping the overall algorithm. default: float=1e-10. @@ -174,12 +174,12 @@ def lagrange_augmentedm(funcs: FuncArray, :param draw: bool, use `bool` to control whether to draw visual images. default: bool=True. :param output_f: bool, use `bool` to control whether to obtain iterative values of `funcs`. default: bool=False. :param method: str, unconstrained kernel used to drive the operation of finding the point of intermediate function. default: str='newton'. - :param lamk: float, constant used to adjust the weight of equation constraints. default: float=6. - :param muk: float, controlled parameter with unequality constrained sigma values. default: float=10. - :param sigma: float, penalty factor used to set the degree of convergence of `funcs`. default: float=8. + :param lamk: float, constant used to adjust the weight of equation constraints. default: float=6.0. + :param muk: float, controlled parameter with unequality constrained sigma values. default: float=10.0. + :param sigma: float, penalty factor used to set the degree of convergence of `funcs`. default: float=8.0. :param alpha: float, value to adjust epsilonk combined with sigma value. default: float=0.5. :param beta: float, value used in continue execution to adjust epsilonk. default: float=0.7. - :param p: float, value to adjust the degree value of convergence named `sigma`. default: float=2. + :param p: float, value to adjust the degree value of convergence named `sigma`. default: float=2.0. :param etak: float, used to set the precision to measure the gradient of funcs. default: float=1e-3. :param epsilon: float, used to set the precision of stopping the overall algorithm. default: float=1e-4. :param k: int, iterative times is used to measure the difficulty of learning the `funcs` in the algorithm. default: int=0. diff --git a/optimtool/constrain/unequal.py b/optimtool/constrain/unequal.py index 24d14fc..80e955e 100644 --- a/optimtool/constrain/unequal.py +++ b/optimtool/constrain/unequal.py @@ -48,7 +48,7 @@ def penalty_quadraticu(funcs: FuncArray, :param draw: bool, use `bool` to control whether to draw visual images. default: bool=True. :param output_f: bool, use `bool` to control whether to obtain iterative values of `funcs`. default: bool=False. :param method: str, unconstrained kernel used to drive the operation of finding the point of intermediate function. default: str='newton'. - :param sigma: float, penalty factor used to set the degree of convergence of `funcs`. default: float=10. + :param sigma: float, penalty factor used to set the degree of convergence of `funcs`. default: float=10.0. :param p: float, parameter to adjust the degree value of convergence named `sigma`. default: float=0.4. :param epsk: float, used to set the precision to accelerate the completion of kernel. default: float=1e-4. :param epsilon: float, used to set the precision of stopping the overall algorithm. default: float=1e-6. @@ -108,11 +108,11 @@ def lagrange_augmentedu(funcs: FuncArray, :param draw: bool, use `bool` to control whether to draw visual images. default: bool=True. :param output_f: bool, use `bool` to control whether to obtain iterative values of `funcs`. default: bool=False. :param method: str, unconstrained kernel used to drive the operation of finding the point of intermediate function. default: str='newton'. - :param muk: float, controlled parameter with unequality constrained sigma values. default: float=10. - :param sigma: float, penalty factor used to set the degree of convergence of `funcs`. default: float=8. + :param muk: float, controlled parameter with unequality constrained sigma values. default: float=10.0. + :param sigma: float, penalty factor used to set the degree of convergence of `funcs`. default: float=8.0. :param alpha: float, value to adjust epsilonk combined with sigma value. default: float=0.2. :param beta: float, value used in continue execution to adjust epsilonk. default: float=0.7. - :param p: float, parameter to adjust the degree value of convergence named `sigma`. default: float=2. + :param p: float, parameter to adjust the degree value of convergence named `sigma`. default: float=2.0. :param eta: float, used to set the precision to measure the gradient of funcs. default: float=1e-1. :param epsilon: float, used to set the precision of stopping the overall algorithm. default: float=1e-4. :param k: int, iterative times is used to measure the difficulty of learning the `funcs` in the algorithm. default: int=0. diff --git a/optimtool/example/Lasso.py b/optimtool/example/Lasso.py index 4fd5bd4..6ae38ce 100644 --- a/optimtool/example/Lasso.py +++ b/optimtool/example/Lasso.py @@ -47,7 +47,7 @@ def gradient(A: NDArray, :param verbose: bool, iteration point, function value, numbers of iteration after the k-th iteration. default: bool=False. :param draw: bool, use `bool` to control whether to draw visual images. default: bool=True. :param output_f: bool, use `bool` to control whether to obtain iterative values of `funcs`. default: bool=False. - :param delta: float, value used to adjust the constant influence of mu. default: float=10. + :param delta: float, value used to adjust the constant influence of mu. default: float=10.0. :param alp: float, initial update step size acting on smooth gradient. default: float=1e-3. :param epsilon: float, used to set the precision of stopping the overall algorithm. default: float=1e-2 :param k: int, iterative times is used to measure the difficulty of learning the `funcs` in the algorithm. default: int=0. diff --git a/optimtool/unconstrain/gradient_descent.py b/optimtool/unconstrain/gradient_descent.py index 99e7ea5..1900b91 100644 --- a/optimtool/unconstrain/gradient_descent.py +++ b/optimtool/unconstrain/gradient_descent.py @@ -136,7 +136,7 @@ def barzilar_borwein(funcs: FuncArray, :param beta: float, factor used to expand alpha for adapting to alphas interval. default: float=0.6 :param M: int, constant used to control the inner `max` process of `Grippo`. default: int=20. :param eta: float, constant used to control `C_k` process of `ZhangHanger`. default: float=0.6. - :param alpha: float, initial step size for nonmonotonic line search method with assert `> 0`. default: float=1. + :param alpha: float, initial step size for nonmonotonic line search method with assert `> 0`. default: float=1.0. :param epsilon: float, used to set the precision of stopping the overall algorithm. default: float=1e-10. :param k: int, iterative times is used to measure the difficulty of learning the `funcs` in the algorithm. default: int=0. diff --git a/optimtool/unconstrain/nonlinear_least_square.py b/optimtool/unconstrain/nonlinear_least_square.py index fb46c0a..1fd2440 100644 --- a/optimtool/unconstrain/nonlinear_least_square.py +++ b/optimtool/unconstrain/nonlinear_least_square.py @@ -93,7 +93,7 @@ def levenberg_marquardt(funcr: FuncArray, :param verbose: bool, iteration point, function value, numbers of iteration after the k-th iteration. default: bool=False. :param draw: bool, use `bool` to control whether to draw visual images. default: bool=True. :param output_f: bool, use `bool` to control whether to obtain iterative values of `funcr`. default: bool=False. - :param lamk: float, the initial factor acting on the product of first-order residual matrices. default: float=1. + :param lamk: float, the initial factor acting on the product of first-order residual matrices. default: float=1.0. :param eta: float, threshold constraint required for controlling iteration point updates. default: float=0.2. :param p1: float, threshold for controlling whether lamk is updated by gamma2. default: float=0.4. :param p2: float, threshold for controlling whether lamk is updated by gamma1. default: float=0.9. diff --git a/optimtool/unconstrain/trust_region.py b/optimtool/unconstrain/trust_region.py index 3cbd4e9..e5d6742 100644 --- a/optimtool/unconstrain/trust_region.py +++ b/optimtool/unconstrain/trust_region.py @@ -49,8 +49,8 @@ def steihaug_CG(funcs: FuncArray, :param verbose: bool, iteration point, function value, numbers of iteration after the k-th iteration. default: bool=False. :param draw: bool, use `bool` to control whether to draw visual images. default: bool=True. :param output_f: bool, use `bool` to control whether to obtain iterative values of `funcs`. default: bool=False. - :param r0: float, the initial radius of gradient search used to update iteration points. default: float=1. - :param rmax: float, the maximal radius of gradient search used to update iteration points. default: float=2. + :param r0: float, the initial radius of gradient search used to update iteration points. default: float=1.0. + :param rmax: float, the maximal radius of gradient search used to update iteration points. default: float=2.0. :param eta: float, threshold constraint required for controlling iteration point updates. default: float=0.2. :param p1: float, threshold for controlling whether r0 is updated by gamma1. default: float=0.4. :param p2: float, threshold for controlling whether r0 is updated by gamma2. default: float=0.6.