https://www.inference.org.uk/mackay/itprnn/ps/