How did you verify is is convex? It is not.
Edit: Yes, what @Michal_Adamaszek answered below is valid, but requires the argument of inv_pos
to be nonnegative in order to be equivalent to the problem as originally stated. I.e., the function is only convex on a limited domain. That is why I said it was non-convex.