Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CVXOPT output suppression with MOSEK

I'm using the optional MOSEK solver with CVXOPT Quadratic Programming, i.e.

sol = cvxopt.solvers.qp(-Q,-p,G,h,A,b,solver='mosek')

Now without using the MOSEK solver, i.e.

sol = cvxopt.solvers.qp(-Q,-p,G,h,A,b)

Terminal output generated by CVXOPT can be suppressed with the command

cvxopt.solvers.options['show_progress'] = False

However, this does not work when using the MOSEK solver option. The MOSEK solver, which I have within a couple of loops, produces a lot of output I'm not interested in, meaning I can't see the output I am interested in (i.e what I choose to output using 'print').

Does anyone know if it's possible to suppress the MOSEK output? Or if not, a potential work around (pipe the output to a file or something)?

Many thanks!

Dan

p.s Sorry I couldn't include more specific tags (I'm not allowed to create new tags).

like image 635
Dan Avatar asked Jun 07 '12 01:06

Dan


People also ask

What algorithm does Cvxopt use for QP?

The function qp is an interface to coneqp for quadratic programs. A discussion of the interior-point algorithms used in the conelp() and coneqp() solvers can be found in the report The CVXOPT linear and quadratic cone program solvers (pdf). All those algorithms are Interior point methods.

What is Mosek solver?

The MOSEK Solver Engine is a plug-in Solver Engine that extends Analytic Solver Optimization or Comprehensive, or Solver SDK Platform or Comprehensive to solve large-scale linear, quadratic, quadratically constrained, and second order cone programming (SOCP) problems, and smooth convex nonlinear programming problems ...

What is Cvxopt in Python?

CVXOPT is a free software package for convex optimization based on the Python programming language. It can be used with the interactive Python interpreter, on the command line by executing Python scripts, or integrated in other software via Python extension modules.


1 Answers

I couldn't figure out how to pass these options through CVXOPT, but after some screening of CVXOPT's source I came up with this solution:

from cvxopt import matrix, solvers
from mosek import iparam
solvers.options['MOSEK'] = {iparam.log: 0}

It works with mosek 6.

like image 93
pettni Avatar answered Oct 01 '22 22:10

pettni