orthrus.solvers namespace

Submodules

orthrus.solvers.linear module

This module contain solvers for linear programs.

class orthrus.solvers.linear.LPNewton(delta: float = 0.001, device: int = - 1, tol: float = 0.001, imax: int = 50, verbosity: int = 1)

Bases: object

convert_type(x)
solve(u0, f, df, hf)
step(ui, f, df, hf, dI)
orthrus.solvers.linear.LPPrimalDualPy(c, A, b, **kwargs)

This is a Python implementation of a code solving a linear program of the form:

max c’x

s.t. Ax>=b, x>=0.

Note this may be a different ``standard form” than seen elsewhere. Original version of this in calcom was named ``rKKTxy” and lived in ssvmclassifier.py. Before that, it was a Matlab code by Sofya Chepushtanova and Michael Kirby, and later implemented in Python by Tomojit Ghosh.

Inputs:

c, np.ndarray of type float or double, with c.shape = (N,1) A, np.ndarray of type float or double, with A.shape = (M,N) b, np.ndarray of type float or double, with b.shape = (M,1)

Optional inputs:

output_flag (integer, default 0, indicating form of the output) verbosity (integer, default 0. Nonzero => print statements used) use_cuda (boolean, default False. indicating whether to use CUDA or not)

max_iters (integer, default 200) delta (float or double, default 0.1) tol (float or double, default 10**-3) dtheta_min (float or double, default 10**-9)

debug (boolean, default False. If True, immediately turns on the Python debugger.)

Outputs: depends on the value of output_flag:

output_flag==0: (default)

The minimizer x, an np.ndarray with x.shape = (N,)

output_flag==1:

IP, a dictionary which has detailed information about the solver and solution. This is used by calcom.classifiers.SSVMClassifier(), as it has auxilliary information used in solving the sparse SVM optimization problem specifically.

NOTE: this may change in the future to make this code less beholden

to SSVM.