Refactored, clarified versions of programs from http://deeplearning.net/tutorial/ with tests.