Skip to content

Instantly share code, notes, and snippets.

@AurelianTactics
Last active August 25, 2019 23:11
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 AurelianTactics/f7c1a7f230b5b83d1b6457e74b9a4d93 to your computer and use it in GitHub Desktop.
Save AurelianTactics/f7c1a7f230b5b83d1b6457e74b9a4d93 to your computer and use it in GitHub Desktop.
Unity ML Basic Env Stable Baselines Implementation
# create unity env
from gym_unity.envs import UnityEnv
env_id = "unity_ray/basic_env_linux/basic_env_linux"
env = UnityEnv(env_id, worker_id=2, use_visual=False, no_graphics=False)
# run stable baselines
env = DummyVecEnv([lambda: env]) # The algorithms require a vectorized environment to run
model = PPO2(MlpPolicy, env, verbose=1)
model.learn(total_timesteps=10000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment