Gradient-Based Shape Optimization for Engineering Using Machine Learning