Teaching Networks to Solve Optimization Problems