araffin commited on
Commit
3bd1c71
1 Parent(s): 7e1fcbf

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +24 -0
README.md CHANGED
@@ -48,6 +48,30 @@ python train.py --algo ppo --env Pendulum-v1 -f logs/
48
  python -m utils.push_to_hub --algo ppo --env Pendulum-v1 -f logs/ -orga sb3
49
  ```
50
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
  ## Hyperparameters
52
  ```python
53
  OrderedDict([('clip_range', 0.2),
 
48
  python -m utils.push_to_hub --algo ppo --env Pendulum-v1 -f logs/ -orga sb3
49
  ```
50
 
51
+ ```python
52
+ from stable_baselines3 import PPO
53
+ from stable_baselines3.common.env_util import make_vec_env
54
+
55
+ # Create the environment
56
+ env_id = "Pendulum-v1"
57
+ env = make_vec_env(env_id, n_envs=1)
58
+
59
+ # Instantiate the agent
60
+ model = PPO(
61
+ "MlpPolicy",
62
+ env,
63
+ gamma=0.98,
64
+ # Using https://proceedings.mlr.press/v164/raffin22a.html
65
+ use_sde=True,
66
+ sde_sample_freq=4,
67
+ learning_rate=1e-3,
68
+ verbose=1,
69
+ )
70
+
71
+ # Train the agent
72
+ model.learn(total_timesteps=int(1e5))
73
+ ```
74
+
75
  ## Hyperparameters
76
  ```python
77
  OrderedDict([('clip_range', 0.2),