User defined functions- objective function

57 views
Skip to first unread message

Ibrahim Pehlivan

unread,
Feb 23, 2021, 7:08:43 PM2/23/21
to cvxpy
Dear all

This should be a rookie question but I have just switched from Matlab to Phyton and trying to use the CVX platform.

I have an objective function consisting of the sum of the norm of some convolutions that I need to define with a for loop (that I need to change adaptively). In Matlab, I would define a function .m file and add it to the path. As I read, I can only use predefined functions in Phyton.

Could you give me tips on how I can define such objective functions in a similar manner? Would just appending such functions to the objective function list work? 

Best regards

Steven Diamond

unread,
Feb 23, 2021, 9:22:59 PM2/23/21
to cvxpy
Anything you can do in CVX you can do in cvxpy (in principle). It's a bit hard to discuss so abstractly, but you can have a Python function in your code that does whatever that .m file does. Then just call it when you're building the cvxpy problem.
Reply all
Reply to author
Forward
0 new messages