Algorithmic design of photonic structures with deep learning