1 norm or absolute value in JuMP?

855 views
Skip to first unread message

Sarah Koehler

unread,
Jul 9, 2015, 4:28:53 PM7/9/15
to juli...@googlegroups.com
Hello,

I am trying to use a Tikhonov regularization in JuMP but it seems I cannot get it to work. I have tried abs(), norm() in combination with sum{...} and I usually get something like: 

"Unrecognized function abs"

I even tried @setNLObjective and that seems to give me the same error. Is this not supported or am I missing something obvious? Thanks!

-Sarah

Miles Lubin

unread,
Jul 9, 2015, 4:36:43 PM7/9/15
to julia-opt
Hi Sarah,

If you're using a convex l1 regularization term, the best approach is to add a few auxiliary variables and linear inequality constraints as follows:

# to represent |x|
@defVar(m, z)
@addConstraint(m, z >= x)
@addConstraint(m, z >= -x)

Systems like CVX and Convex.jl do this transformation automatically, after verifying that the problem is indeed convex (this transformation is not valid otherwise). In JuMP, you currently have to do this transformation by hand.

Miles

--
You received this message because you are subscribed to the Google Groups "julia-opt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to julia-opt+...@googlegroups.com.
Visit this group at http://groups.google.com/group/julia-opt.
For more options, visit https://groups.google.com/d/optout.

Sarah Koehler

unread,
Jul 9, 2015, 4:45:05 PM7/9/15
to juli...@googlegroups.com
Okay so I just have to use a slack variable. Alright, thanks!

Iain Dunning

unread,
Jul 9, 2015, 5:44:22 PM7/9/15
to julia-opt
Norms are on our mind though, so keep a look out.

Btw, is your objective linear/quadratic? I noticed you were using @setNLObjective.

Sarah Koehler

unread,
Jul 9, 2015, 5:48:49 PM7/9/15
to juli...@googlegroups.com
Oh no, my objective is convex quadratic. I just tried @setNLObjective in case support for the 1 norm had somehow slipped under the radar for the regular @setObjective.
Reply all
Reply to author
Forward
0 new messages