kissin42 commited on
Commit
36890df
·
verified ·
1 Parent(s): 0c7e7af

Update README.md for ccnets/humanoid/medium-v0

Browse files
Files changed (1) hide show
  1. README.md +155 -149
README.md CHANGED
@@ -1,149 +1,155 @@
1
- ---
2
- license: cc-by-4.0
3
- viewer: false
4
- tags:
5
- - reinforcement-learning
6
- - offline-reinforcement-learning
7
- - mujoco
8
- - minari
9
- - causal-gpt-rl
10
- ---
11
-
12
- # Causal GPT-RL — MuJoCo trajectories
13
-
14
- MuJoCo trajectories packaged as [Minari](https://minari.farama.org) datasets, in
15
- **offline-RL** form. What makes this repository different from a collection of
16
- rollouts is where the trajectories come from: **they were recorded by a policy
17
- that had never seen expert data.**
18
-
19
- The first dataset is **1000 episodes of `Humanoid-v5`, recorded by a policy
20
- trained on `simple` and `medium` trajectories alone** — one episode at every
21
- retention length from 1 to 1000, each value used exactly once.
22
-
23
- ## Why this repository exists
24
-
25
- The scarcity of good trajectories is the binding constraint in offline RL. There
26
- is no internet-scale corpus of behaviour, and the usual way out is circular —
27
- expert datasets need an expert policy, and an expert policy is most of the
28
- problem already solved.
29
-
30
- So the question is not only *can a model learn from the current dataset*, but
31
- **can it produce a better next one**:
32
-
33
- ```
34
- simple -> model -> medium
35
- simple + medium -> model -> better than medium
36
- simple + medium + that -> model -> better still
37
- ... repeated, never using expert data ...
38
- -> expert
39
- ```
40
-
41
- Each dataset here is one turn of that loop. No expert trajectories are used at
42
- any point.
43
-
44
- ## Where the loop stands
45
-
46
- Normalized skill on the [model card's](https://huggingface.co/ccnets/causal-gpt-rl)
47
- scale — a random policy is `0`, expert is `100`:
48
-
49
- | | dataset | mean return | normalized |
50
- |---|---|---:|---:|
51
- | input | `mujoco/humanoid/simple-v0` | 5484.6 | 63.3 |
52
- | input | `mujoco/humanoid/medium-v0` | 7014.5 | 81.3 |
53
- | **this repo** | **`mujoco/humanoid-v5/medium-v0`** | **7494.3** | **86.9** |
54
- | target | expert | 8605.1 | 100.0 |
55
-
56
- The recorded trajectories score **+479.8 return above the medium dataset the
57
- policy was trained on**, and **85.7 % of the 1000 episodes beat that dataset's
58
- mean**. The gap left to expert is 13.1 normalized points.
59
-
60
- ## `humanoid-v5/medium-v0`
61
-
62
- Recorded by the
63
- [`ccnets/causal-gpt-rl/humanoid-v5`](https://huggingface.co/ccnets/causal-gpt-rl)
64
- bundle, trained on the `simple` and `medium` trajectories of that environment
65
- with no expert data.
66
-
67
- | | |
68
- |---|---|
69
- | Episodes | 1000 |
70
- | Transitions | 924,747 |
71
- | Episode length | 924.7 mean (87 min, 1000 max) |
72
- | Return | 7494.3 ± 1667.6 (515.4 min, 8340.7 max) |
73
- | Ended by termination | 156 |
74
- | Ended by the 1000-step limit | 844 |
75
- | Observation / action | `Box(348,)` / `Box(17,)`, float32 |
76
-
77
- ### One retention per episode
78
-
79
- Every episode carries a distinct seed and a **different retention** —
80
- `kv_cache_max_len` from 1 to 1000, each value used exactly once. Retention is
81
- how many steps of its own past the policy keeps while acting. It is a load-time
82
- argument, so all 1000 episodes come from the same weights and the same trained
83
- context length of 32; only how much history each rollout kept differs.
84
-
85
- `episode_metadata.jsonl` maps every episode file to the retention that recorded
86
- it — episodes are numbered in the order they finished, not by retention:
87
-
88
- ```json
89
- {"episode": "ep_000000", "row": 4, "transitions": 113, "terminated": true, "truncated": false, "kv_cache_max_len": 16}
90
- ```
91
-
92
- That makes the dataset usable two ways: as offline-RL trajectories, and as a
93
- measurement of what retention does to a policy's behaviour. Within it, episodes
94
- recorded between 16 and 128 steps of retention average 91.1 normalized against
95
- 85.5 for those above 500 — but with one episode per retention, seed variance is
96
- larger than the effect, so treat the per-retention axis as evidence to build on
97
- rather than a settled result.
98
-
99
- ### Files
100
-
101
- ```
102
- humanoid-v5/medium-v0/
103
- data/main_data.hdf5 the Minari dataset
104
- data/metadata.json
105
- episode_metadata.jsonl one line per episode: file, row, length, retention
106
- collection_spec.json what recorded it: bundle, context length, retentions
107
- validation_summary.json every number quoted above
108
- ```
109
-
110
- ### Load it
111
-
112
- ```python
113
- import minari
114
-
115
- dataset = minari.load_dataset("mujoco/humanoid-v5/medium-v0")
116
- episode = next(dataset.iterate_episodes())
117
- print(episode.observations.shape, episode.rewards.sum())
118
- ```
119
-
120
- Place the `humanoid-v5/medium-v0` directory under your Minari datasets path
121
- (`~/.minari/datasets/mujoco/`), or download the repository and point
122
- `MINARI_DATASETS_PATH` at it.
123
-
124
- The files were recorded with `torch 2.12.0`, `gymnasium 1.2.2` and
125
- `mujoco 3.8.1`; a different simulator release is a different measurement even
126
- with identical weights and seeds. The recorder and packager are
127
- [`collection/`](https://github.com/ccnets-team/causal-gpt-rl/tree/main/collection),
128
- and the cycle this repository is built on is described in
129
- [Improving the next dataset](https://github.com/ccnets-team/causal-gpt-rl/blob/main/collection/docs/improving-the-next-dataset.md).
130
-
131
- ## A note on names
132
-
133
- `mujoco/humanoid/medium-v0` and `mujoco/humanoid-v5/medium-v0` differ by one
134
- segment and are not the same data. The first is the **input** — a Minari dataset
135
- this project trained on. The second is this repository's **output** — what the
136
- resulting policy recorded, scoring above the first. The name marks the rung of
137
- the ladder the data was produced at, not a quality claim about the file.
138
-
139
- ## Companion repos
140
-
141
- - Policy bundles for eight MuJoCo environments:
142
- [ccnets/causal-gpt-rl](https://huggingface.co/ccnets/causal-gpt-rl)
143
- - Unity ML-Agents trajectories, with a calibrated quality ladder:
144
- [ccnets/causal-gpt-rl-unity-datasets](https://huggingface.co/datasets/ccnets/causal-gpt-rl-unity-datasets)
145
- - Code:
146
- [ccnets-team/causal-gpt-rl](https://github.com/ccnets-team/causal-gpt-rl)
147
-
148
- **한국어 카드 / Korean edition:**
149
- [README.ko.md](https://huggingface.co/datasets/ccnets/causal-gpt-rl-datasets/blob/main/README.ko.md)
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-4.0
3
+ viewer: false
4
+ tags:
5
+ - reinforcement-learning
6
+ - offline-reinforcement-learning
7
+ - mujoco
8
+ - minari
9
+ - causal-gpt-rl
10
+ ---
11
+
12
+ # Causal GPT-RL — MuJoCo trajectories
13
+
14
+ MuJoCo trajectories packaged as [Minari](https://minari.farama.org) datasets, in
15
+ **offline-RL** form. What makes this repository different from a collection of
16
+ rollouts is where the trajectories come from: **they were recorded by a policy
17
+ that had never seen expert data.**
18
+
19
+ The first dataset is **1000 episodes of `Humanoid-v5`, recorded by a policy
20
+ trained on `simple` and `medium` trajectories alone** — one episode at every
21
+ retention length from 1 to 1000, each value used exactly once.
22
+
23
+ ## Why this repository exists
24
+
25
+ The scarcity of good trajectories is the binding constraint in offline RL. There
26
+ is no internet-scale corpus of behaviour, and the usual way out is circular —
27
+ expert datasets need an expert policy, and an expert policy is most of the
28
+ problem already solved.
29
+
30
+ So the question is not only *can a model learn from the current dataset*, but
31
+ **can it produce a better next one**:
32
+
33
+ ```
34
+ simple -> model -> medium
35
+ simple + medium -> model -> better than medium
36
+ simple + medium + that -> model -> better still
37
+ ... repeated, never using expert data ...
38
+ -> expert
39
+ ```
40
+
41
+ Each dataset here is one turn of that loop. No expert trajectories are used at
42
+ any point.
43
+
44
+ ## Where the loop stands
45
+
46
+ Normalized skill on the [model card's](https://huggingface.co/ccnets/causal-gpt-rl)
47
+ scale — a random policy is `0`, expert is `100`:
48
+
49
+ | | dataset | mean return | normalized |
50
+ |---|---|---:|---:|
51
+ | input | Minari `mujoco/humanoid/simple-v0` | 5484.6 | 63.3 |
52
+ | input | Minari `mujoco/humanoid/medium-v0` | 7014.5 | 81.3 |
53
+ | **this repo** | **`ccnets/humanoid/medium-v0`** | **7494.3** | **86.9** |
54
+ | target | expert | 8605.1 | 100.0 |
55
+
56
+ "Minari" marks the two [Farama-published](https://minari.farama.org/datasets/mujoco/humanoid/)
57
+ datasets this project trained on. Everything else in this repository is
58
+ recorded, not downloaded.
59
+
60
+ The recorded trajectories score **+479.8 return above the medium dataset the
61
+ policy was trained on**, and **85.7 % of the 1000 episodes beat that dataset's
62
+ mean**. The gap left to expert is 13.1 normalized points.
63
+
64
+ ## `humanoid/medium-v0`
65
+
66
+ Recorded by the
67
+ [`ccnets/causal-gpt-rl/humanoid-v5`](https://huggingface.co/ccnets/causal-gpt-rl)
68
+ bundle, trained on the Minari `simple-v0` and `medium-v0` trajectories of that
69
+ environment with no expert data.
70
+
71
+ | | |
72
+ |---|---|
73
+ | Episodes | 1000 |
74
+ | Transitions | 924,747 |
75
+ | Episode length | 924.7 mean (87 min, 1000 max) |
76
+ | Return | 7494.3 ± 1667.6 (515.4 min, 8340.7 max) |
77
+ | Ended by termination | 156 |
78
+ | Ended by the 1000-step limit | 844 |
79
+ | Observation / action | `Box(348,)` / `Box(17,)`, float32 |
80
+
81
+ ### One retention per episode
82
+
83
+ Every episode carries a distinct seed and a **different retention** —
84
+ `kv_cache_max_len` from 1 to 1000, each value used exactly once. Retention is
85
+ how many steps of its own past the policy keeps while acting. It is a load-time
86
+ argument, so all 1000 episodes come from the same weights and the same trained
87
+ context length of 32; only how much history each rollout kept differs.
88
+
89
+ `episode_metadata.jsonl` maps every episode file to the retention that recorded
90
+ it — episodes are numbered in the order they finished, not by retention:
91
+
92
+ ```json
93
+ {"episode": "ep_000000", "row": 4, "transitions": 113, "terminated": true, "truncated": false, "kv_cache_max_len": 16}
94
+ ```
95
+
96
+ That makes the dataset usable two ways: as offline-RL trajectories, and as a
97
+ measurement of what retention does to a policy's behaviour. Within it, episodes
98
+ recorded between 16 and 128 steps of retention average 91.1 normalized against
99
+ 85.5 for those above 500 — but with one episode per retention, seed variance is
100
+ larger than the effect, so treat the per-retention axis as evidence to build on
101
+ rather than a settled result.
102
+
103
+ ### Files
104
+
105
+ ```
106
+ humanoid/medium-v0/
107
+ data/main_data.hdf5 the Minari dataset
108
+ data/metadata.json
109
+ episode_metadata.jsonl one line per episode: file, row, length, retention
110
+ collection_spec.json what recorded it: bundle, context length, retentions
111
+ validation_summary.json every number quoted above
112
+ ```
113
+
114
+ ### Load it
115
+
116
+ ```python
117
+ import minari
118
+
119
+ dataset = minari.load_dataset("ccnets/humanoid/medium-v0")
120
+ episode = next(dataset.iterate_episodes())
121
+ print(episode.observations.shape, episode.rewards.sum())
122
+ ```
123
+
124
+ Place the `humanoid/medium-v0` directory under `ccnets/` in your Minari
125
+ datasets path — `~/.minari/datasets/ccnets/humanoid/medium-v0` — or point
126
+ `MINARI_DATASETS_PATH` at wherever you keep it.
127
+
128
+ The files were recorded with `torch 2.12.0`, `gymnasium 1.2.2` and
129
+ `mujoco 3.8.1`; a different simulator release is a different measurement even
130
+ with identical weights and seeds. The recorder and packager are
131
+ [`collection/`](https://github.com/ccnets-team/causal-gpt-rl/tree/main/collection),
132
+ and the cycle this repository is built on is described in
133
+ [Improving the next dataset](https://github.com/ccnets-team/causal-gpt-rl/blob/main/collection/docs/improving-the-next-dataset.md).
134
+
135
+ ## A note on the name
136
+
137
+ `ccnets/humanoid/medium-v0` keeps the rung — `medium-v0` — and changes the
138
+ namespace. The rung says where in the ladder the data was produced: after the
139
+ medium trajectories, before expert. The namespace says who produced it, and
140
+ keeps it clear of Farama's `mujoco/humanoid/medium-v0`, which is the dataset
141
+ the recording policy was trained on. Minari resolves a dataset by id, so the two
142
+ can sit in one `~/.minari` without either hiding the other — which matters
143
+ here, because they are the input and the output of the same experiment.
144
+
145
+ ## Companion repos
146
+
147
+ - Policy bundles for eight MuJoCo environments:
148
+ [ccnets/causal-gpt-rl](https://huggingface.co/ccnets/causal-gpt-rl)
149
+ - Unity ML-Agents trajectories, with a calibrated quality ladder:
150
+ [ccnets/causal-gpt-rl-unity-datasets](https://huggingface.co/datasets/ccnets/causal-gpt-rl-unity-datasets)
151
+ - Code:
152
+ [ccnets-team/causal-gpt-rl](https://github.com/ccnets-team/causal-gpt-rl)
153
+
154
+ **한국어 카드 / Korean edition:**
155
+ [README.ko.md](https://huggingface.co/datasets/ccnets/causal-gpt-rl-datasets/blob/main/README.ko.md)