Still playing with CVXPY. This time I get an interesting error. Let us look at this minimal code
import cvxpy as cp
import numpy as np
A = np.random.normal(0, 1, (64,6))
b = np.random.normal(0, 1, (64,1))
theta = cp.Variable(shape = (6,1))
prob = cp.Problem(
cp.Minimize(cp.max(A*theta -b) <= 5),
[-10 <= theta, theta <= 10])
Once compiled, I get the following error:
~\Anaconda3\lib\site-packages\cvxpy\expressions\constants\constant.py in init(self, value) 42 self._sparse = True 43 else: ---> 44 self._value = intf.DEFAULT_INTF.const_to_matrix(value) 45 self._sparse = False 46 self._imag = None
~\Anaconda3\lib\site-packages\cvxpy\interface\numpy_interface\ndarray_interface.py in const_to_matrix(self, value, convert_scalars) 48 return result 49 else: ---> 50 return result.astype(numpy.float64) 51 52 # Return an identity matrix.
TypeError: float() argument must be a string or a number, not 'Inequality'