Skip to content

Instantly share code, notes, and snippets.

@TheBojda
Last active December 22, 2022 14:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TheBojda/3188064d9596d2c3691eba0372b4e972 to your computer and use it in GitHub Desktop.
Save TheBojda/3188064d9596d2c3691eba0372b4e972 to your computer and use it in GitHub Desktop.
PyGAD (Genetic Algorithm) reinforcement learning example with Tensorflow and OpenAI Gym (CartPole v1)
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@connorfuhrman
Copy link

Thanks for posting! A note for people getting here after the gym step API has changed:

  • alter the initial observation to be the 0th element of env.reset(), i.e., observation = env.reset()[0]
  • alter the result of step to be observation_next, reward, done, truncated, info = env.step(action)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment