Last active
August 25, 2019 23:11
-
-
Save AurelianTactics/f7c1a7f230b5b83d1b6457e74b9a4d93 to your computer and use it in GitHub Desktop.
Unity ML Basic Env Stable Baselines Implementation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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