Machine learning for inverse lithography: using stochastic gradient descent for robust photomask synthesis