adelie.constraint.one_sided#
- adelie.constraint.one_sided(D: ndarray, b: ndarray, *, method: str = 'proximal_newton', configs: dict | None = None, dtype: float32 | float64 | None = None)[source]#
Creates a one-sided bound constraint.
The one-sided bound constraint is given by \(D x \leq b\) where \(D\) is a diagonal matrix with \(\pm 1\) along the diagonal and \(b \geq 0\).
- Parameters:
- D(d,) ndarray
Diagonal matrix \(D\).
- b(d,) ndarray
Bound \(b\).
- methodstr, optional
Method for
solve()
. It must be one of the following:"proximal_newton"
: proximal Newton algorithm."admm"
: ADMM algorithm.
Default is
"proximal_newton"
.- configsdict, optional
Configurations specific to
method
. For each method type, the following arguments are used:"proximal_newton"
:- max_itersint, optional
Maximum number of proximal Newton iterations. Default is
100
.- tolfloat, optional
Convergence tolerance for proximal Newton. Default is
1e-9
.- pinball_max_itersint, optional
Maximum number of coordinate descent iterations for the pinball least squares solver. Default is
int(1e5)
.- pinball_tolfloat, optional
Convergence tolerance for the pinball least squares solver. Default is
1e-7
.- slackfloat, optional
Slackness for backtracking when proximal Newton overshoots the boundary where primal is zero. The smaller the value, the less slack so that the backtrack takes the iterates closer to (but outside) the boundary.
Warning
If this value is too small,
solve()
may not converge!Default is
1e-4
.
"admm"
:- max_itersint, optional
Maximum number of ADMM iterations. Default is
int(1e5)
.- tol_absfloat, optional
Absolute convergence tolerance. Default is
1e-7
.- tol_relfloat, optional
Relative convergence tolerance. Default is
1e-7
.- rhofloat, optional
ADMM penalty parameter. Default is
1
.
If
None
, the default values are used. Default isNone
.- dtypeUnion[float32, float64], optional
The underlying data type. If
None
, it is inferred fromb
, in which caseb
must have an underlying data type ofnumpy.float32
ornumpy.float64
. Default isNone
.
- Returns:
- wrap
Wrapper constraint object.