This MATLAB program implements the complete BPTT process for GRU. We provide two algorithms here, a direct but quadratic time algorithm for easy understanding, and an optimized linear time algorithm.
Please see the technical report for detailed derivation and explanation.