File size: 2,386 Bytes
b99d6b1
 
221cd4f
3233cb8
 
3cf7061
 
 
 
 
 
 
bdffe78
 
e812c65
e4306f9
e812c65
 
 
 
 
e4306f9
e812c65
 
 
 
 
e4306f9
e812c65
 
 
 
 
e4306f9
e812c65
 
 
 
 
 
221cd4f
 
1e2b3d7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
74
75
76
77
78
---
pipeline_tag: reinforcement-learning
library_name: pytorch
language:
- en
tags:
- reinforcement-learning
- deep-reinforcement-learning
- pytorch
- gymnasium
- collision-avoidance
- navigation
- self-driving
- autonomous-vehicle
model-index:
- name: sac_v2-230704203226
  results:  
  - task:
      type: reinforcement-learning
      name: reinforcement-learning
    dataset:
      name: urban-road-v0
      type: RoadEnv
    metrics:
    - type: mean-reward
      value: 0.53 - 0.72
      name: mean-reward
- name: sac_v2_lstm-230706072839
  results: 
  - task:
      type: reinforcement-learning
      name: reinforcement-learning
    dataset:
      name: urban-road-v0
      type: RoadEnv
    metrics:
    - type: mean-reward
      value: 0.62 - 0.76
      name: mean-reward

---

This repository contains model weights for the agents performing in [RoadEnv](https://github.com/kengboon/RoadEnv).

## Models
- Recurrent Soft Actor-Critic (RSAC/SAC-LSTM) [[Agent](https://github.com/kengboon/RoadEnv/blob/main/rl_algorithms2/sac_v2_lstm.py)] [[Training](https://github.com/kengboon/RoadEnv/blob/main/scripts/training-sac_v2-lstm-2.py)] [[Test](https://github.com/kengboon/RoadEnv/blob/main/scripts/test-sac_v2_lstm.py)]
- Recurrent Soft Actor-Critic Share (RSAC-Share) [[Paper](https://arxiv.org/abs/2110.12628)] [[Agent](https://github.com/kengboon/RoadEnv/blob/main/rl_algorithms2/sac_v2_lstm_share.py)] [[Training](https://github.com/kengboon/RoadEnv/blob/main/scripts/training-rsac_share.py)]
- Soft Actor-Critic (SAC) [[Agent](https://github.com/kengboon/RoadEnv/blob/main/rl_algorithms2/sac_v2.py)] [[Training](https://github.com/kengboon/RoadEnv/blob/main/scripts/training-sac_v2-2.py)] [[Test](https://github.com/kengboon/RoadEnv/blob/main/scripts/test-sac_v2.py)]

## Usage
```Python
# Register environment
from road_env import register_road_envs
register_road_envs()

# Make environment
import gymnasium as gym
env = gym.make('urban-road-v0', render_mode='rgb_array')

# Configure parameters (example)
env.configure({
    "random_seed": None,
    "duration": 60,
})

obs, info = env.reset()

# Graphic display
import matplotlib.pyplot as plt
plt.imshow(env.render())

# Execution
done = truncated = False
while not (done or truncated):
    action = ... # Your agent code here
    obs, reward, done, truncated, info = env.step(action)
    env.render() # Update graphic
```