Teaching Recurrent Neural Networks to Infer Global Temporal Structure from Local Examples