Deep neural networks are a cost-effective machine-learning approach for solving the inverse problem of constructing electromagnetic fields that enable desired transitions in quantum systems.