1

enter image description here

subject to the constraint that square of Frobenius norm of Ds matrix has to be less than or equal to 1.

Currently I am using CVXPY library to solve the objective function. My code sample looks like

import cvxpy as cp
import numpy as np


np.random.seed(1)
Xs = np.random.randn(100, 4096)
Ys = np.random.randn(100, 300)

# Define and solve the CVXPY problem.
Ds = cp.Variable(shape=(300, 4096))

lamda1 = 1

obj = cp.Minimize(cp.square(cp.norm(Xs - (Ys * Ds), "fro")) + lamda1 * cp.norm(Ds, "nuc"))
constraints = [cp.square(cp.norm(Ds, "fro")) <= 1]

prob = cp.Problem(obj, constraints)
prob.solve(solver=cp.SCS, verbose=True)

The console gives an error that

Solver 'SCS' failed. Try another solver or solve with verbose=True for more information. Try re-centering the problem data around 0 and re-scaling to reduce the dynamic range.

I event tried to experiment with different solvers like cp.ECOS but they do not optimize the function.

Any suggestions ?

S.B
  • 13,077
  • 10
  • 22
  • 49
Upendra01
  • 344
  • 3
  • 5
  • 15

0 Answers0