danieladejumo commited on
Commit
b33f216
·
1 Parent(s): 802ae06

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +8 -4
README.md CHANGED
@@ -25,12 +25,16 @@ This is a trained model of a **PPO** agent playing **MountainCarContinuous-v0**
25
  using the [stable-baselines3 library](https://github.com/DLR-RM/stable-baselines3).
26
 
27
  ## Usage (with Stable-baselines3)
28
- TODO: Add your code
29
-
30
 
31
  ```python
32
- from stable_baselines3 import ...
33
  from huggingface_sb3 import load_from_hub
34
 
35
- ...
 
 
 
 
 
 
36
  ```
 
25
  using the [stable-baselines3 library](https://github.com/DLR-RM/stable-baselines3).
26
 
27
  ## Usage (with Stable-baselines3)
 
 
28
 
29
  ```python
30
+ from stable_baselines3 import PPO
31
  from huggingface_sb3 import load_from_hub
32
 
33
+ # load and create the model
34
+ model_path = load_from_hub("danieladejumo/ppo-mountan_car_continuous", "ppo-mountan_car_continuous.zip")
35
+ model = PPO.load(model_path)
36
+
37
+ # create Mountain Car Continuous environment and evaluate the trained agent
38
+ env = gym.make("MountainCarContinuous-v0")
39
+ mean_return, std_return = evaluate_policy(model, env, n_eval_episodes=50, deterministic=True)
40
  ```