Machine Learning Methods for Nanophotonic Design, Simulation, and Operation