ThomasSimonini HF staff commited on
Commit
f39a67d
1 Parent(s): 979ffb7

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +42 -0
README.md ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - deep-reinforcement-learning
4
+ - reinforcement-learning
5
+ - stable-baselines3
6
+ ---
7
+ # ThomasSimonini/ppo-SpaceInvadersNoFrameskip-v4
8
+
9
+ <video src="https://huggingface.co/ThomasSimonini/ppo-SpaceInvadersNoFrameskip-v4/blob/main/output.mp4" controls autoplay loop/>
10
+
11
+ This is a pre-trained model of a PPO agent playing SpaceInvadersNoFrameskip using the [stable-baselines3](https://github.com/DLR-RM/stable-baselines3) library. It is taken from [RL-trained-agents](https://github.com/DLR-RM/rl-trained-agents)
12
+
13
+ ### Usage (with Stable-baselines3)
14
+ Using this model becomes easy when you have stable-baselines3 and huggingface_sb3 installed:
15
+
16
+ ```
17
+ pip install stable-baselines3
18
+ pip install huggingface_sb3
19
+ ```
20
+
21
+ Then, you can use the model like this:
22
+
23
+ ```python
24
+ import gym
25
+
26
+ from huggingface_sb3 import load_from_hub
27
+ from stable_baselines3 import PPO
28
+ from stable_baselines3.common.evaluation import evaluate_policy
29
+ from stable_baselines3.common.env_util import make_atari_env
30
+ from stable_baselines3.common.vec_env import VecFrameStack
31
+
32
+ # Retrieve the model from the hub
33
+ ## repo_id = id of the model repository from the Hugging Face Hub (repo_id = {organization}/{repo_name})
34
+ ## filename = name of the model zip file from the repository
35
+ checkpoint = load_from_hub(repo_id="ThomasSimonini/ppo-SpaceInvadersNoFrameskip-v4", filename="SpaceInvadersNoFrameskip-v4")
36
+ print(checkpoint)
37
+ model = PPO.load(checkpoint)
38
+ ```
39
+
40
+ ### Evaluation Results
41
+ Mean_reward: {your_evaluation_results}
42
+