Inverse Design and Optimization along Machine Learning for Metasurfaces