adamlizerbram commited on
Commit
520edbd
·
verified ·
1 Parent(s): 7883324

Add model card

Browse files
Files changed (1) hide show
  1. README.md +58 -1
README.md CHANGED
@@ -1,3 +1,60 @@
1
  ---
2
- license: mit
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ license: apache-2.0
3
+ base_model: convaiinnovations/laya
4
+ tags:
5
+ - reinforcement-learning
6
+ - highway-env
7
+ - autonomous-driving
8
+ - safety-shield
9
+ - laya
10
  ---
11
+
12
+ # CS654 Final Project: model weights
13
+
14
+ These are the final weights for a CS 654 (Reinforcement Learning) course project. The project compares DQN, Laya, and a Laya-shielded DQN on [highway-env](https://highway-env.farama.org/) (`highway-fast-v0`).
15
+
16
+ | Folder | Contents |
17
+ |---|---|
18
+ | `laya-highway/` | [Laya](https://huggingface.co/convaiinnovations/laya), fine-tuned to judge driving actions as safe or unsafe and to choose actions |
19
+
20
+ ## Download
21
+
22
+ ```bash
23
+ hf download adamlizerbram/cs654-final-project --include "laya-highway/*" --local-dir models/final # -> models/final/laya-highway
24
+ ```
25
+
26
+ ```python
27
+ import laya
28
+ agent = laya.load("adamlizerbram/cs654-final-project", subfolder="laya-highway")
29
+ ```
30
+
31
+ ## laya-highway
32
+
33
+ One checkpoint answers two questions about a text description of the highway around the ego car:
34
+
35
+ - **Safety** (`noul`): will a proposed action lead to a collision or a gap under 5 m within 3 s? This yes/no answer drives the safety shield.
36
+ - **Action** (`choice`): which legal action is safest while still making good progress? This is the Laya-alone driving policy.
37
+
38
+ **Data.** Labels come from simulation, not humans. For each visited state and each legal action, a copy of the simulator applies the action and then keeps lane and speed for 2 more steps.
39
+ - An action is **unsafe** if the copy crashes or the same-lane gap drops below 5 m.
40
+ - The **action label** is the safe action with the most forward progress.
41
+ - Train episodes use seeds 0–299 and validation episodes use seeds 10000–10049. Evaluation seeds (100000+) were never used for training or tuning.
42
+
43
+ **Training.** `laya-train` from laya 0.4.30 on an A100:
44
+ - 4 epochs with the default `rlcd` objective, `--shuffle-options`, and an effective batch of 64
45
+ - 16,805 train items and 400 calibration items
46
+ - Temperature scaling fitted T = 5.0 for both question types
47
+
48
+ **Validation results** (before → after fine-tuning):
49
+
50
+ | Question | Items | Accuracy | ECE |
51
+ |---|---|---|---|
52
+ | Safety | 2,754 | 0.503 → 0.947 | 0.303 → 0.025 |
53
+ | Action | 697 | 0.144 → 0.891 | 0.586 → 0.048 |
54
+
55
+ The fine-tuned P(unsafe) is nearly binary: 99% of predictions fall below 0.1 or at 0.9 and above, and both clusters are well calibrated. 6.2% of truly unsafe actions are scored below 0.1.
56
+
57
+ **Limitations.**
58
+ - The labels imitate a 3-second lookahead rule, not an optimal driver.
59
+ - `highway-fast-v0` uses coarse 5 Hz physics.
60
+ - The model reads a fixed text format, so other state descriptions are out of distribution.