Weakly-convex–concave min–max optimization: provable algorithms and applications in machine learning