#X = cp.Variable(shape=(66, 66), PSD = True)
Y = np.dot(np.dot(Z2.T,X),Z1)
#X = np.array(X1, dtype=object)
print(Z2.shape)
print(Z1.shape)
print(Y.shape)
objective = cp.Minimize(cp.norm(np.dot(np.dot(Z2.T,X),Z1),"nuc"))
BUT with this version,
Z1 = np.random.rand(66, 2)
Z2 = np.random.rand(66, 2)
#X = np.random.rand(66, 66)
X = cp.Variable(shape=(66, 66), PSD = True)
Y = np.dot(np.dot(Z2.T,X),Z1)
print(Z2.shape)
print(Z1.shape)
print(Y.shape)
objective = cp.Minimize(cp.norm(np.dot(np.dot(Z2.T,X),Z1),"nuc"))
I got this error !
%%%%%
ValueError Traceback (most recent call last)
<ipython-input-401-6290055a0757> in <module>()
19 print(Y.shape)
20
---> 21 objective = cp.Minimize(cp.norm(np.dot(np.dot(Z2.T,X),Z1),"nuc"))
22
23 #problem = cp.Problem(objective)
/Users/mohameddaoudi/opt/anaconda2/lib/python2.7/site-packages/cvxpy/atoms/norm.pyc in norm(x, p, axis)
45 return normNuc(x)
46 elif p == "fro":
---> 47 return pnorm(x, 2, axis)
48 elif p == 2:
49 if axis is None and x.is_matrix():
/Users/mohameddaoudi/opt/anaconda2/lib/python2.7/site-packages/cvxpy/expressions/expression.pyc in cast_to_const(expr)
/Users/mohameddaoudi/opt/anaconda2/lib/python2.7/site-packages/cvxpy/expressions/constants/constant.pyc in __init__(self, value)
42 self._size = intf.size(self.value)
43 self._is_pos, self._is_neg = intf.sign(self.value)
---> 44 super(Constant, self).__init__()
45
46 def name(self):
/Users/mohameddaoudi/opt/anaconda2/lib/python2.7/site-packages/cvxpy/interface/numpy_interface/ndarray_interface.pyc in const_to_matrix(self, value, convert_scalars)
48 # Return an identity matrix.
49 def identity(self, size):
---> 50 return numpy.eye(size)
51
52 # Return the dimensions of the matrix.