-
Notifications
You must be signed in to change notification settings - Fork 178
Open
Description
Hi, Thanks for sharing this awesome package!
I am trying to optimize the gamma of the EGM problem (Please see link:) as follow:
# set gamma as cp.Parameter
gamma = cp.Parameter(1, nonneg=True)
gamma_tch = torch.log(torch.ones(1))
k = len(mus)
def Objs(w):
u = cvx.vstack([cvx.log(pi[i])
- gamma * mus[i] @ w
+ (gamma**2/2) * cvx.quad_form(w, Sigmas[i]) for i in range(k)])
return cvx.log_sum_exp(u)
w = cvx.Variable(n)
objective = cvx.Minimize(Objs(w))
constraints = [ w >= 0, cvx.sum(w) == 1 ]
egm_prob = cvx.Problem(objective, constraints)
cvxpylayer = CvxpyLayer(egm_prob, [torch.exp(gamma_tch)], [w]),
But the egm_prob can not pass the DPP test:
ValueError: Problem must be DPP.
Please is there any ways to work around this issue?
Thanks!
Metadata
Metadata
Assignees
Labels
No labels