Skip to content

Commit

Permalink
sb3 switch
Browse files Browse the repository at this point in the history
  • Loading branch information
jkterry1 authored Mar 12, 2021
1 parent 13eca86 commit cfff5c8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tutorials/13_lines.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from stable_baselines.common.policies import CnnPolicy
from stable_baselines import PPO2
from stable_baselines3.common.policies import CnnPolicy
from stable_baselines3 import PPO2
from pettingzoo.butterfly import pistonball_v4
import supersuit as ss

Expand All @@ -10,7 +10,7 @@
env = ss.pettingzoo_env_to_vec_env_v0(env)
env = ss.concat_vec_envs_v0(env, 8, num_cpus=4, base_class='stable_baselines')

model = PPO2(CnnPolicy, env, verbose=3, gamma=0.99, n_steps=125, ent_coef=0.01, learning_rate=0.00025, vf_coef=0.5, max_grad_norm=0.5, lam=0.95, nminibatches=4, noptepochs=4, cliprange=0.2, cliprange_vf=1)
model = PPO(CnnPolicy, env, verbose=3, gamma=0.99, n_steps=125, ent_coef=0.01, learning_rate=0.00025, vf_coef=0.5, max_grad_norm=0.5, lam=0.95, nminibatches=4, noptepochs=4, cliprange=0.2, cliprange_vf=1)
model.learn(total_timesteps=2000000)
model.save("policy")

Expand All @@ -21,7 +21,7 @@
env = ss.resize_v0(env, x_size=84, y_size=84)
env = ss.frame_stack_v1(env, 3)

model = PPO2.load("policy")
model = PPO.load("policy")

env.reset()
for agent in env.agent_iter():
Expand Down

0 comments on commit cfff5c8

Please sign in to comment.