0

I have a list beta_list, where each entry in the list is a vector. I want to minimize the following function

def two_norm(this_beta, beta):
  cp.Pnorm(beta - this_beta, p = 2)**2

def obj_fn(beta_list, beta):
  sum(map(two_norm, beta_list, itertools.repeat(beta, len(beta_list))))

Can cvxpy handle objective function of this form, where a function is applied to a list using map in python?

  • Have you tried it out? You're more likely to get answers if you show an error or a complete example. – Jacques Kvam Feb 27 '19 at 06:10
  • actually it did work. I also heard back from the author on google mailing list, confirming as long as it is a cvxpy expression, and don't pass in a function handle - it should be fine – statlearner Mar 21 '19 at 20:39

0 Answers0