# What causes the Shape (convex or non-convex) of the cost function?

There are different types of cost functions like Cross-entropy, absolute error, mean squared error.

When can we expect the cost function to be non-convex? Does this depend upon the type of cost function we choose? Or does this depend upon the Model we choose like when we have higher order polynomial Model?

• I think it is not convex in truest sense but we try to make it so and also make sure not to get trapped in a local minima – DuttaA Jun 26 '18 at 12:21
• It all depends on your final function which is going to be optimised. – Media Aug 25 '18 at 17:29

The cost function is convex if its Second Order Derivative is positive semidefinite (i.e. $\geq0$ ).