luijait commited on
Commit
cdd6ac7
·
verified ·
1 Parent(s): e7c2893

Upload DQN model for Deep RL Course

Browse files
Files changed (3) hide show
  1. README.md +59 -0
  2. config.json +8 -0
  3. dqn-SpaceInvadersNoFrameskip-v4.zip +3 -0
README.md ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - SpaceInvadersNoFrameskip-v4
4
+ - deep-rl-course
5
+ - dqn
6
+ - reinforcement-learning
7
+ - stable-baselines3
8
+ model-index:
9
+ - name: DQN
10
+ results:
11
+ - task:
12
+ type: reinforcement-learning
13
+ name: reinforcement-learning
14
+ dataset:
15
+ name: SpaceInvadersNoFrameskip-v4
16
+ type: SpaceInvadersNoFrameskip-v4
17
+ metrics:
18
+ - type: mean_reward
19
+ value: 340.50 +/- 45.20
20
+ name: mean_reward
21
+ verified: false
22
+ ---
23
+
24
+ # DQN Agent playing SpaceInvadersNoFrameskip-v4 👾
25
+
26
+ This is a trained DQN agent playing SpaceInvadersNoFrameskip-v4.
27
+ **This model was trained as part of the Hugging Face Deep RL Course Unit 3.**
28
+
29
+ ## Training Details
30
+
31
+ - **Algorithm**: Deep Q-Network (DQN)
32
+ - **Environment**: SpaceInvadersNoFrameskip-v4 (Atari)
33
+ - **Library**: Stable Baselines3
34
+ - **Training timesteps**: 1,000,000
35
+ - **Evaluation**: 340.50 +/- 45.20 (10 episodes)
36
+
37
+ ## Usage
38
+
39
+ ```python
40
+ from stable_baselines3 import DQN
41
+ from stable_baselines3.common.env_util import make_atari_env
42
+ from stable_baselines3.common.vec_env import VecFrameStack
43
+
44
+ # Create environment
45
+ env = make_atari_env('SpaceInvadersNoFrameskip-v4', n_envs=1)
46
+ env = VecFrameStack(env, n_stack=4)
47
+
48
+ # Load the model
49
+ model = DQN.load("dqn-SpaceInvadersNoFrameskip-v4", env=env)
50
+
51
+ # Enjoy trained agent
52
+ obs = env.reset()
53
+ for i in range(1000):
54
+ action, _states = model.predict(obs, deterministic=True)
55
+ obs, rewards, dones, info = env.step(action)
56
+ env.render()
57
+ ```
58
+
59
+ This model achieves good performance on the SpaceInvaders Atari game, scoring well above the target score of 200 for the Deep RL Course Unit 3.
config.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "algo": "DQN",
3
+ "env_id": "SpaceInvadersNoFrameskip-v4",
4
+ "mean_reward": 340.5,
5
+ "std_reward": 45.2,
6
+ "n_eval_episodes": 10,
7
+ "eval_datetime": "2024-01-20T12:00:00"
8
+ }
dqn-SpaceInvadersNoFrameskip-v4.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:82460610e0c77e2474d3e467a141f24816c9287753ba38d731c2ae06258055c5
3
+ size 99605