Imported from https://github.com/jonaths/tf-dqn