API reference

The symbols below are the complete public namespace exported by dbcp 1.0.

Modeling and solving

class dbcp.BiconvexProblem(biconvex_objective, x_var, y_var, constraints=None)[source]

A biconvex problem solved by proximal alternating convex search.

The supplied variable groups define the two fixed convex subproblems.

property x_prob

The direct x-problem with y-variables fixed.

property y_prob

The direct y-problem with x-variables fixed.

property penalty_prob

The lazily constructed slack-penalized problem.

property penalty_x_prob

The slack-penalized x-problem with y-variables fixed.

property penalty_y_prob

The slack-penalized y-problem with x-variables fixed.

property slack_vars

The slack variables in the lazily constructed penalty problem.

solve(solver='SCS', lbd=0.1, max_iter=100, abs_tol=1e-06, *args, rel_tol=1e-06, mode='direct', nu=None, slack_tol=None, **kwargs)[source]

Solve the biconvex problem using direct or penalty ACS.

Parameters:
  • solver (str) – The cvxpy Solver to use for solving the convex subproblems.

  • lbd (float) – The regularization parameter of the proximal term.

  • max_iter (int) – The maximum number of ACS iterations.

  • abs_tol (float) – The absolute tolerance for the gap between x- and y-problems.

  • rel_tol (float) – The relative tolerance for the gap between x- and y-problems.

  • mode ({“direct”, “penalty”}) – The solution mode. Direct mode finds a feasible initial point; penalty mode adds penalized slacks and permits an infeasible start.

  • nu (float | None) – The finite, strictly positive penalty applied to total slack in penalty mode. The effective default is 1. A non-None value is invalid in direct mode; None is equivalent to omission.

  • slack_tol (float | None) – The total-slack tolerance in penalty mode. The effective default is 1e-6. A non-None value is invalid in direct mode; None is equivalent to omission.

  • *args – Additional positional arguments forwarded to each alternating subproblem solve, but not to feasible initialization.

  • **kwargs – Additional keyword arguments forwarded to each alternating subproblem solve. proj_max_iter instead configures feasible initialization, and method retains its CVXPY meaning.

property status

The status of the last solve.

property value

The objective value of the last solve.

is_dbcp()[source]

Check if the problem follows DBCP rules.

Expressions

dbcp.convolve(x, y)[source]

Discrete convolution of two 1-D cvxpy expressions.

Suppose \(x\) and \(y\) are 1-D cvxpy expressions of lengths \(m\) and \(n\), respectively. This function returns a cvxpy expression \(c\) of length \(m + n - 1\), where

\[c_k = \sum_{i + j = k} x_i y_j,\quad k = 1, \ldots, m + n - 1.\]

Matches numpy.convolve for 1-D arrays.

This function extends cvxpy.convolve atom to support the convolution operation between two cvxpy expressions.

Parameters:
  • x (cp.Expression) – A 1-D cvxpy expression.

  • y (cp.Expression) – A 1-D cvxpy expression.

Returns:

The convolution of x and y.

Return type:

cp.Expression

Package version

dbcp.__version__ = '1.0.1'

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to ‘utf-8’. errors defaults to ‘strict’.