I took a glance at the gist and didn’t see any obvious issues. I’d be happy to take a deeper look at this on Monday.
In your tf code, are you also using the exact same architecture/data/optim? (activation fn, lr, adam optimizer, sequence length, padding, …)