Extended convexity and smoothness and their applications in deep learning