You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
functionmylogisticloss(expr)
n =length(expr)
e =hcat(expr, zeros(n))
# log(sum(exp(x))) <= t <=> sum(exp(x)) <= exp(t) <=> sum(exp(x - t)) <= 1
t =Variable(n)
z =sum(exp(e - t .*ones(size(e))))
add_constraint!(t, 1>= z)
returnsum(t)
end
but that subverts DCP since the extended formulation is only valid in a convex context, but the resulting sum(t) is affine. The proper fix therefore is probably to have a vectorized version of logsumexp as a new atom and use it here.
Convex.jl/src/atoms/LogSumExpAtom.jl
Line 48 in 2978c32
I guess I missed this one in #614
The text was updated successfully, but these errors were encountered: