File size: 1,483 Bytes
f39a67d
 
 
 
 
 
 
 
 
 
f934b21
3057e3f
f39a67d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a626212
f39a67d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
---
tags:
- deep-reinforcement-learning
- reinforcement-learning
- stable-baselines3
---
# ThomasSimonini/ppo-SpaceInvadersNoFrameskip-v4

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)

<video src="https://huggingface.co/ThomasSimonini/ppo-SpaceInvadersNoFrameskip-v4/resolve/main/output.mp4" controls autoplay loop></video>

### Usage (with Stable-baselines3)
Using this model becomes easy when you have stable-baselines3 and huggingface_sb3 installed:
```
pip install stable-baselines3
pip install huggingface_sb3
```

Then, you can use the model like this:

```python
import gym

from huggingface_sb3 import load_from_hub
from stable_baselines3 import PPO
from stable_baselines3.common.evaluation import evaluate_policy
from stable_baselines3.common.env_util import make_atari_env
from stable_baselines3.common.vec_env import VecFrameStack

# Retrieve the model from the hub
## repo_id =  id of the model repository from the Hugging Face Hub (repo_id = {organization}/{repo_name})
## filename = name of the model zip file from the repository
checkpoint = load_from_hub(repo_id="ThomasSimonini/ppo-SpaceInvadersNoFrameskip-v4", filename="SpaceInvadersNoFrameskip-v4")
print(checkpoint)
model = PPO.load(checkpoint)
```

### Evaluation Results
Mean_reward: 627.160 (162 eval episodes)