Skip to content

Instantly share code, notes, and snippets.

@araffin
Last active September 18, 2018 09:29
Show Gist options
  • Save araffin/e4f44d1944e7c4f0e3afd12cca35cee7 to your computer and use it in GitHub Desktop.
Save araffin/e4f44d1944e7c4f0e3afd12cca35cee7 to your computer and use it in GitHub Desktop.
Train a RL agent in one line of code!
from stable_baselines import PPO2
# Define and train a model in one line of code !
trained_model = PPO2('MlpPolicy', 'CartPole-v1').learn(total_timesteps=10000)
# you can then access the gym env using trained_model.get_env()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment