Python code for the Kaggle competition digit recognizer