PythonNumPy + PyTorch

RNN

The Code

A line-by-line walkthrough of train.py, from character encoding through the forward recurrence, manual BPTT, gradient clipping, and text generation. Every line annotated.