Inverse Design of Metamaterials for Tailored Linear and Nonlinear Optical Responses Using Deep Learning