Adaptive design of nanoscale dielectric structures for photonics