keon / deep-q-learning

Minimal Deep Q Learning (DQN & DDQN) implementations in Keras
https://keon.io/deep-q-learning
MIT License
1.28k stars 454 forks source link

Minor issue with globally scoped variable `env` #1

Closed timvieira closed 7 years ago

timvieira commented 7 years ago

I found a minor issue on line 42.

Currently:

    return env.action_space.sample()

Should be:

    return self.env.action_space.sample()

p.s. It's better practice to not put a bunch of stuff in the global namespace (e.g., under if __name__ == '__main__':). It's safer to use an actual main() method.