Inferring Algorithmic Patterns with Stack-Augmented Recurrent Nets