How to express 1/(1+exp(-x)) in the CVX? Many thanks!

It’s easy to see that the function 1/(1+exp(-x)) is concave with respect to variable x, but i wonder to konw that how to express this function in the CVX?Many thanks!

How do you plan to use it? It is convex for x <= 0, and concave for x >= 0. It is actually log-concave, which means that its logarithm is concave.

inv_pos(1+exp(-x)) is accepted by CVX, and reported as log-concave. However, the argument 1+exp(-x) violates the inv_pos help which states its argument must be concave. I don’t know whether that is undocumented special behavior for log-convexity and log-concavity, and I don’t trust the correctness of using it.

I think you’re out of luck with CVX. I will mark this as non-convex.

okk, anyway, thanks for your help!