File size: 1,582 Bytes
b84ffe5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
---
tags:
- LunarLander-v2
- ppo
- deep-reinforcement-learning
- reinforcement-learning
- custom-implementation
- deep-rl-course
model-index:
- name: PPO
  results:
  - task:
      type: reinforcement-learning
      name: reinforcement-learning
    dataset:
      name: LunarLander-v2
      type: LunarLander-v2
    metrics:
    - type: mean_reward
      value: 292.50 +/- 11.20
      name: mean_reward
      verified: false
---

# PPO Agent Playing LunarLander-v2

This is a trained model of a **PPO (Proximal Policy Optimization)** agent playing **LunarLander-v2** implemented from scratch with PyTorch using the CleanRL framework.

## 🏆 Evaluation Results
- **Mean Reward**: **292.50 +/- 11.20**
- **Lower Bound Result (Mean - Std)**: **281.30**
- **Episodes Evaluated**: 10
- **Status**: **Solved** (Environment threshold: 200.0)

## Hyperparameters
```python
{
  'anneal_lr': True,
  'batch_size': 2048,
  'capture_video': False,
  'clip_coef': 0.2,
  'clip_vloss': True,
  'cuda': True,
  'ent_coef': 0.01,
  'env_id': 'LunarLander-v2',
  'exp_name': 'ppo',
  'gae': True,
  'gae_lambda': 0.95,
  'gamma': 0.99,
  'learning_rate': 0.00025,
  'max_grad_norm': 0.5,
  'num_envs': 16,
  'num_minibatches': 4,
  'num_steps': 128,
  'repo_id': 'umesh251/ppo-LunarLander-v2',
  'seed': 1,
  'total_timesteps': 500000,
  'update_epochs': 4,
  'vf_coef': 0.5
}
```

## How to use
```python
import gym
import torch
from test_agent import Agent

device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
env = gym.make("LunarLander-v2")
agent = Agent(env).to(device)
```