x-ppo 0.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- x_ppo-0.0.1/.gitignore +129 -0
- x_ppo-0.0.1/LICENSE +21 -0
- x_ppo-0.0.1/PKG-INFO +278 -0
- x_ppo-0.0.1/README.md +235 -0
- x_ppo-0.0.1/pyproject.toml +62 -0
- x_ppo-0.0.1/x_ppo/__init__.py +1 -0
- x_ppo-0.0.1/x_ppo/ppo.py +30 -0
x_ppo-0.0.1/.gitignore
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
pip-wheel-metadata/
|
|
24
|
+
share/python-wheels/
|
|
25
|
+
*.egg-info/
|
|
26
|
+
.installed.cfg
|
|
27
|
+
*.egg
|
|
28
|
+
MANIFEST
|
|
29
|
+
|
|
30
|
+
# PyInstaller
|
|
31
|
+
# Usually these files are written by a python script from a template
|
|
32
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
33
|
+
*.manifest
|
|
34
|
+
*.spec
|
|
35
|
+
|
|
36
|
+
# Installer logs
|
|
37
|
+
pip-log.txt
|
|
38
|
+
pip-delete-this-directory.txt
|
|
39
|
+
|
|
40
|
+
# Unit test / coverage reports
|
|
41
|
+
htmlcov/
|
|
42
|
+
.tox/
|
|
43
|
+
.nox/
|
|
44
|
+
.coverage
|
|
45
|
+
.coverage.*
|
|
46
|
+
.cache
|
|
47
|
+
nosetests.xml
|
|
48
|
+
coverage.xml
|
|
49
|
+
*.cover
|
|
50
|
+
*.py,cover
|
|
51
|
+
.hypothesis/
|
|
52
|
+
.pytest_cache/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
target/
|
|
76
|
+
|
|
77
|
+
# Jupyter Notebook
|
|
78
|
+
.ipynb_checkpoints
|
|
79
|
+
|
|
80
|
+
# IPython
|
|
81
|
+
profile_default/
|
|
82
|
+
ipython_config.py
|
|
83
|
+
|
|
84
|
+
# pyenv
|
|
85
|
+
.python-version
|
|
86
|
+
|
|
87
|
+
# pipenv
|
|
88
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
89
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
90
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
91
|
+
# install all needed dependencies.
|
|
92
|
+
#Pipfile.lock
|
|
93
|
+
|
|
94
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
|
|
95
|
+
__pypackages__/
|
|
96
|
+
|
|
97
|
+
# Celery stuff
|
|
98
|
+
celerybeat-schedule
|
|
99
|
+
celerybeat.pid
|
|
100
|
+
|
|
101
|
+
# SageMath parsed files
|
|
102
|
+
*.sage.py
|
|
103
|
+
|
|
104
|
+
# Environments
|
|
105
|
+
.env
|
|
106
|
+
.venv
|
|
107
|
+
env/
|
|
108
|
+
venv/
|
|
109
|
+
ENV/
|
|
110
|
+
env.bak/
|
|
111
|
+
venv.bak/
|
|
112
|
+
|
|
113
|
+
# Spyder project settings
|
|
114
|
+
.spyderproject
|
|
115
|
+
.spyproject
|
|
116
|
+
|
|
117
|
+
# Rope project settings
|
|
118
|
+
.ropeproject
|
|
119
|
+
|
|
120
|
+
# mkdocs documentation
|
|
121
|
+
/site
|
|
122
|
+
|
|
123
|
+
# mypy
|
|
124
|
+
.mypy_cache/
|
|
125
|
+
.dmypy.json
|
|
126
|
+
dmypy.json
|
|
127
|
+
|
|
128
|
+
# Pyre type checker
|
|
129
|
+
.pyre/
|
x_ppo-0.0.1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 Phil Wang
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
x_ppo-0.0.1/PKG-INFO
ADDED
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: x-ppo
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: PPO
|
|
5
|
+
Project-URL: Homepage, https://pypi.org/project/x-ppo/
|
|
6
|
+
Project-URL: Repository, https://github.com/lucidrains/x-ppo
|
|
7
|
+
Author-email: Phil Wang <lucidrains@gmail.com>
|
|
8
|
+
License: MIT License
|
|
9
|
+
|
|
10
|
+
Copyright (c) 2020 Phil Wang
|
|
11
|
+
|
|
12
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
13
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
14
|
+
in the Software without restriction, including without limitation the rights
|
|
15
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
16
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
17
|
+
furnished to do so, subject to the following conditions:
|
|
18
|
+
|
|
19
|
+
The above copyright notice and this permission notice shall be included in all
|
|
20
|
+
copies or substantial portions of the Software.
|
|
21
|
+
|
|
22
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
24
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
25
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
26
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
27
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
28
|
+
SOFTWARE.
|
|
29
|
+
License-File: LICENSE
|
|
30
|
+
Keywords: artificial intelligence,deep learning,proximal policy optimization,reinforcement learning
|
|
31
|
+
Classifier: Development Status :: 4 - Beta
|
|
32
|
+
Classifier: Intended Audience :: Developers
|
|
33
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
34
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
35
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
36
|
+
Requires-Python: >=3.10
|
|
37
|
+
Requires-Dist: torch-einops-utils>=0.1.24
|
|
38
|
+
Requires-Dist: torch>=2.4
|
|
39
|
+
Provides-Extra: examples
|
|
40
|
+
Provides-Extra: test
|
|
41
|
+
Requires-Dist: pytest; extra == 'test'
|
|
42
|
+
Description-Content-Type: text/markdown
|
|
43
|
+
|
|
44
|
+
<img src="./lunar.gif" width="400px"></img>
|
|
45
|
+
|
|
46
|
+
*1k steps*
|
|
47
|
+
|
|
48
|
+
## PPO
|
|
49
|
+
|
|
50
|
+
An implementation of PPO with recent random improvements
|
|
51
|
+
|
|
52
|
+
The phasic part has been removed, repository to be renamed. I do not think it does anything
|
|
53
|
+
|
|
54
|
+
## Install
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
$ pip install -r requirements.txt
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
You may need to install `swig`
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
$ apt install swig
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Use
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
$ python train.py
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Citations
|
|
73
|
+
|
|
74
|
+
```bibtex
|
|
75
|
+
@article{Schulman2017ProximalPO,
|
|
76
|
+
title = {Proximal Policy Optimization Algorithms},
|
|
77
|
+
author = {John Schulman and Filip Wolski and Prafulla Dhariwal and Alec Radford and Oleg Klimov},
|
|
78
|
+
journal = {ArXiv},
|
|
79
|
+
year = {2017},
|
|
80
|
+
volume = {abs/1707.06347},
|
|
81
|
+
url = {https://api.semanticscholar.org/CorpusID:28695052}
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
```bibtex
|
|
86
|
+
@article{Zhang2024ReLU2WD,
|
|
87
|
+
title = {ReLU2 Wins: Discovering Efficient Activation Functions for Sparse LLMs},
|
|
88
|
+
author = {Zhengyan Zhang and Yixin Song and Guanghui Yu and Xu Han and Yankai Lin and Chaojun Xiao and Chenyang Song and Zhiyuan Liu and Zeyu Mi and Maosong Sun},
|
|
89
|
+
journal = {ArXiv},
|
|
90
|
+
year = {2024},
|
|
91
|
+
volume = {abs/2402.03804},
|
|
92
|
+
url = {https://api.semanticscholar.org/CorpusID:267499856}
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
```bibtex
|
|
97
|
+
@inproceedings{Lee2024SimBaSB,
|
|
98
|
+
title = {SimBa: Simplicity Bias for Scaling Up Parameters in Deep Reinforcement Learning},
|
|
99
|
+
author = {Hojoon Lee and Dongyoon Hwang and Donghu Kim and Hyunseung Kim and Jun Jet Tai and Kaushik Subramanian and Peter R. Wurman and Jaegul Choo and Peter Stone and Takuma Seno},
|
|
100
|
+
year = {2024},
|
|
101
|
+
url = {https://api.semanticscholar.org/CorpusID:273346233}
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
```bibtex
|
|
106
|
+
@inproceedings{anonymous2024the,
|
|
107
|
+
title = {The Complexity Dynamics of Grokking},
|
|
108
|
+
author = {Anonymous},
|
|
109
|
+
booktitle = {Submitted to The Thirteenth International Conference on Learning Representations},
|
|
110
|
+
year = {2024},
|
|
111
|
+
url = {https://openreview.net/forum?id=07N9jCfIE4},
|
|
112
|
+
note = {under review}
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
```bibtex
|
|
117
|
+
@article{Yang2020LearningLD,
|
|
118
|
+
title = {Learning Low-rank Deep Neural Networks via Singular Vector Orthogonality Regularization and Singular Value Sparsification},
|
|
119
|
+
author = {Huanrui Yang and Minxue Tang and Wei Wen and Feng Yan and Daniel Hu and Ang Li and Hai Helen Li and Yiran Chen},
|
|
120
|
+
journal = {2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops (CVPRW)},
|
|
121
|
+
year = {2020},
|
|
122
|
+
pages = {2899-2908},
|
|
123
|
+
url = {https://api.semanticscholar.org/CorpusID:213940794}
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
```bibtex
|
|
128
|
+
@article{Farebrother2024StopRT,
|
|
129
|
+
title = {Stop Regressing: Training Value Functions via Classification for Scalable Deep RL},
|
|
130
|
+
author = {Jesse Farebrother and Jordi Orbay and Quan Ho Vuong and Adrien Ali Taiga and Yevgen Chebotar and Ted Xiao and Alex Irpan and Sergey Levine and Pablo Samuel Castro and Aleksandra Faust and Aviral Kumar and Rishabh Agarwal},
|
|
131
|
+
journal = {ArXiv},
|
|
132
|
+
year = {2024},
|
|
133
|
+
volume = {abs/2403.03950},
|
|
134
|
+
url = {https://api.semanticscholar.org/CorpusID:268253088}
|
|
135
|
+
}
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
```bibtex
|
|
139
|
+
@article{Lee2024AnalysisClippedCritic,
|
|
140
|
+
title = {On Analysis of Clipped Critic Loss in Proximal Policy Gradient},
|
|
141
|
+
author = {Yongjin Lee, Moonyoung Chung},
|
|
142
|
+
journal = {Authorea},
|
|
143
|
+
year = {2024}
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
```bibtex
|
|
148
|
+
@inproceedings{Felizardo2025ARL,
|
|
149
|
+
title = {A Reinforcement Learning Method for Environments with Stochastic Variables: Post-Decision Proximal Policy Optimization with Dual Critic Networks},
|
|
150
|
+
author = {Leonardo Kanashiro Felizardo and Edoardo Fadda and Paolo Brandimarte and Emilio Del-Moral-Hernandez and Mari'a Cristina Vasconcelos Nascimento},
|
|
151
|
+
year = {2025},
|
|
152
|
+
url = {https://api.semanticscholar.org/CorpusID:277621941}
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
```bibtex
|
|
157
|
+
@misc{xie2025simplepolicyoptimization,
|
|
158
|
+
title = {Simple Policy Optimization},
|
|
159
|
+
author = {Zhengpeng Xie and Qiang Zhang and Fan Yang and Marco Hutter and Renjing Xu},
|
|
160
|
+
year = {2025},
|
|
161
|
+
eprint = {2401.16025},
|
|
162
|
+
archivePrefix = {arXiv},
|
|
163
|
+
primaryClass = {cs.LG},
|
|
164
|
+
url = {https://arxiv.org/abs/2401.16025},
|
|
165
|
+
}
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
```bibtex
|
|
169
|
+
@inproceedings{anonymous2025flow,
|
|
170
|
+
title = {Flow Policy Gradients for Legged Robots},
|
|
171
|
+
author = {Anonymous},
|
|
172
|
+
booktitle = {Submitted to The Fourteenth International Conference on Learning Representations},
|
|
173
|
+
year = {2025},
|
|
174
|
+
url = {https://openreview.net/forum?id=BA6n0nmagi},
|
|
175
|
+
note = {under review}
|
|
176
|
+
}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
```bibtex
|
|
180
|
+
@inproceedings{Seitzer2022Pitfalls,
|
|
181
|
+
title = {On the Pitfalls of Heteroscedastic Uncertainty Estimation with Probabilistic Neural Networks},
|
|
182
|
+
author = {Maximilian Seitzer and Abdul-Saboor Sheikh and Georg Martius},
|
|
183
|
+
booktitle = {International Conference on Learning Representations},
|
|
184
|
+
year = {2022},
|
|
185
|
+
url = {https://openreview.net/forum?id=9O_xF9y7A-}
|
|
186
|
+
}
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
```bibtex
|
|
190
|
+
@inproceedings{Wang2025EvolutionaryPO,
|
|
191
|
+
title = {Evolutionary Policy Optimization},
|
|
192
|
+
author = {Jianren Wang and Yifan Su and Abhinav Gupta and Deepak Pathak},
|
|
193
|
+
booktitle = {Advances in Neural Information Processing Systems},
|
|
194
|
+
year = {2025},
|
|
195
|
+
url = {https://arxiv.org/abs/2503.19037}
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
```bibtex
|
|
200
|
+
@misc{osband2026delightfulpolicygradient,
|
|
201
|
+
title = {Delightful Policy Gradient},
|
|
202
|
+
author = {Ian Osband},
|
|
203
|
+
year = {2026},
|
|
204
|
+
eprint = {2603.14608},
|
|
205
|
+
archivePrefix = {arXiv},
|
|
206
|
+
primaryClass = {cs.LG},
|
|
207
|
+
url = {https://arxiv.org/abs/2603.14608},
|
|
208
|
+
}
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
```bibtex
|
|
212
|
+
@misc{eysenbach2018diversityneedlearningskills,
|
|
213
|
+
title = {Diversity is All You Need: Learning Skills without a Reward Function},
|
|
214
|
+
author = {Benjamin Eysenbach and Abhishek Gupta and Julian Ibarz and Sergey Levine},
|
|
215
|
+
year = {2018},
|
|
216
|
+
eprint = {1802.06070},
|
|
217
|
+
archivePrefix = {arXiv},
|
|
218
|
+
primaryClass = {cs.AI},
|
|
219
|
+
url = {https://arxiv.org/abs/1802.06070},
|
|
220
|
+
}
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
```bibtex
|
|
224
|
+
@misc{mustafaoglu2025evolutionarypolicyoptimization,
|
|
225
|
+
title = {Evolutionary Policy Optimization},
|
|
226
|
+
author = {Zelal Su "Lain" Mustafaoglu and Keshav Pingali and Risto Miikkulainen},
|
|
227
|
+
year = {2025},
|
|
228
|
+
eprint = {2504.12568},
|
|
229
|
+
archivePrefix = {arXiv},
|
|
230
|
+
primaryClass = {cs.LG},
|
|
231
|
+
url = {https://arxiv.org/abs/2504.12568},
|
|
232
|
+
}
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
```bibtex
|
|
236
|
+
@misc{han2026firefrobeniusisometryreinitializationbalancing,
|
|
237
|
+
title = {FIRE: Frobenius-Isometry Reinitialization for Balancing the Stability-Plasticity Tradeoff},
|
|
238
|
+
author = {Isaac Han and Sangyeon Park and Seungwon Oh and Donghu Kim and Hojoon Lee and Kyung-Joong Kim},
|
|
239
|
+
year = {2026},
|
|
240
|
+
eprint = {2602.08040},
|
|
241
|
+
archivePrefix = {arXiv},
|
|
242
|
+
primaryClass = {cs.LG},
|
|
243
|
+
url = {https://arxiv.org/abs/2602.08040},
|
|
244
|
+
}
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
```bibtex
|
|
248
|
+
@misc{tian2026chunkingcritic,
|
|
249
|
+
title = {Chunking the Critic: A Transformer-based Soft Actor-Critic with N-Step Returns},
|
|
250
|
+
author = {Dong Tian and Onur Celik and Gerhard Neumann},
|
|
251
|
+
year = {2026},
|
|
252
|
+
eprint = {2503.03660},
|
|
253
|
+
archivePrefix = {arXiv},
|
|
254
|
+
primaryClass = {cs.LG},
|
|
255
|
+
url = {https://arxiv.org/abs/2503.03660},
|
|
256
|
+
}
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
```bibtex
|
|
260
|
+
@misc{hahn2025action,
|
|
261
|
+
title = {Action Chunking Proximal Policy Optimization for Universal Robotic Dexterous Grasping},
|
|
262
|
+
author = {Sanghyun Hahn and Jonghyun Choi},
|
|
263
|
+
year = {2025},
|
|
264
|
+
url = {https://openreview.net/forum?id=WFQnqY1c39}
|
|
265
|
+
}
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
```bibtex
|
|
269
|
+
@misc{shin2026adaptiveactionchunkingmultichunk,
|
|
270
|
+
title = {Adaptive Action Chunking via Multi-Chunk Q Value Estimation},
|
|
271
|
+
author = {Yongjae Shin and Jongseong Chae and Seongmin Kim and Jongeui Park and Youngchul Sung},
|
|
272
|
+
year = {2026},
|
|
273
|
+
eprint = {2605.10044},
|
|
274
|
+
archivePrefix = {arXiv},
|
|
275
|
+
primaryClass = {cs.LG},
|
|
276
|
+
url = {https://arxiv.org/abs/2605.10044},
|
|
277
|
+
}
|
|
278
|
+
```
|
x_ppo-0.0.1/README.md
ADDED
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
<img src="./lunar.gif" width="400px"></img>
|
|
2
|
+
|
|
3
|
+
*1k steps*
|
|
4
|
+
|
|
5
|
+
## PPO
|
|
6
|
+
|
|
7
|
+
An implementation of PPO with recent random improvements
|
|
8
|
+
|
|
9
|
+
The phasic part has been removed, repository to be renamed. I do not think it does anything
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
$ pip install -r requirements.txt
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
You may need to install `swig`
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
$ apt install swig
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Use
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
$ python train.py
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Citations
|
|
30
|
+
|
|
31
|
+
```bibtex
|
|
32
|
+
@article{Schulman2017ProximalPO,
|
|
33
|
+
title = {Proximal Policy Optimization Algorithms},
|
|
34
|
+
author = {John Schulman and Filip Wolski and Prafulla Dhariwal and Alec Radford and Oleg Klimov},
|
|
35
|
+
journal = {ArXiv},
|
|
36
|
+
year = {2017},
|
|
37
|
+
volume = {abs/1707.06347},
|
|
38
|
+
url = {https://api.semanticscholar.org/CorpusID:28695052}
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
```bibtex
|
|
43
|
+
@article{Zhang2024ReLU2WD,
|
|
44
|
+
title = {ReLU2 Wins: Discovering Efficient Activation Functions for Sparse LLMs},
|
|
45
|
+
author = {Zhengyan Zhang and Yixin Song and Guanghui Yu and Xu Han and Yankai Lin and Chaojun Xiao and Chenyang Song and Zhiyuan Liu and Zeyu Mi and Maosong Sun},
|
|
46
|
+
journal = {ArXiv},
|
|
47
|
+
year = {2024},
|
|
48
|
+
volume = {abs/2402.03804},
|
|
49
|
+
url = {https://api.semanticscholar.org/CorpusID:267499856}
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
```bibtex
|
|
54
|
+
@inproceedings{Lee2024SimBaSB,
|
|
55
|
+
title = {SimBa: Simplicity Bias for Scaling Up Parameters in Deep Reinforcement Learning},
|
|
56
|
+
author = {Hojoon Lee and Dongyoon Hwang and Donghu Kim and Hyunseung Kim and Jun Jet Tai and Kaushik Subramanian and Peter R. Wurman and Jaegul Choo and Peter Stone and Takuma Seno},
|
|
57
|
+
year = {2024},
|
|
58
|
+
url = {https://api.semanticscholar.org/CorpusID:273346233}
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
```bibtex
|
|
63
|
+
@inproceedings{anonymous2024the,
|
|
64
|
+
title = {The Complexity Dynamics of Grokking},
|
|
65
|
+
author = {Anonymous},
|
|
66
|
+
booktitle = {Submitted to The Thirteenth International Conference on Learning Representations},
|
|
67
|
+
year = {2024},
|
|
68
|
+
url = {https://openreview.net/forum?id=07N9jCfIE4},
|
|
69
|
+
note = {under review}
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
```bibtex
|
|
74
|
+
@article{Yang2020LearningLD,
|
|
75
|
+
title = {Learning Low-rank Deep Neural Networks via Singular Vector Orthogonality Regularization and Singular Value Sparsification},
|
|
76
|
+
author = {Huanrui Yang and Minxue Tang and Wei Wen and Feng Yan and Daniel Hu and Ang Li and Hai Helen Li and Yiran Chen},
|
|
77
|
+
journal = {2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops (CVPRW)},
|
|
78
|
+
year = {2020},
|
|
79
|
+
pages = {2899-2908},
|
|
80
|
+
url = {https://api.semanticscholar.org/CorpusID:213940794}
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
```bibtex
|
|
85
|
+
@article{Farebrother2024StopRT,
|
|
86
|
+
title = {Stop Regressing: Training Value Functions via Classification for Scalable Deep RL},
|
|
87
|
+
author = {Jesse Farebrother and Jordi Orbay and Quan Ho Vuong and Adrien Ali Taiga and Yevgen Chebotar and Ted Xiao and Alex Irpan and Sergey Levine and Pablo Samuel Castro and Aleksandra Faust and Aviral Kumar and Rishabh Agarwal},
|
|
88
|
+
journal = {ArXiv},
|
|
89
|
+
year = {2024},
|
|
90
|
+
volume = {abs/2403.03950},
|
|
91
|
+
url = {https://api.semanticscholar.org/CorpusID:268253088}
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
```bibtex
|
|
96
|
+
@article{Lee2024AnalysisClippedCritic,
|
|
97
|
+
title = {On Analysis of Clipped Critic Loss in Proximal Policy Gradient},
|
|
98
|
+
author = {Yongjin Lee, Moonyoung Chung},
|
|
99
|
+
journal = {Authorea},
|
|
100
|
+
year = {2024}
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
```bibtex
|
|
105
|
+
@inproceedings{Felizardo2025ARL,
|
|
106
|
+
title = {A Reinforcement Learning Method for Environments with Stochastic Variables: Post-Decision Proximal Policy Optimization with Dual Critic Networks},
|
|
107
|
+
author = {Leonardo Kanashiro Felizardo and Edoardo Fadda and Paolo Brandimarte and Emilio Del-Moral-Hernandez and Mari'a Cristina Vasconcelos Nascimento},
|
|
108
|
+
year = {2025},
|
|
109
|
+
url = {https://api.semanticscholar.org/CorpusID:277621941}
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
```bibtex
|
|
114
|
+
@misc{xie2025simplepolicyoptimization,
|
|
115
|
+
title = {Simple Policy Optimization},
|
|
116
|
+
author = {Zhengpeng Xie and Qiang Zhang and Fan Yang and Marco Hutter and Renjing Xu},
|
|
117
|
+
year = {2025},
|
|
118
|
+
eprint = {2401.16025},
|
|
119
|
+
archivePrefix = {arXiv},
|
|
120
|
+
primaryClass = {cs.LG},
|
|
121
|
+
url = {https://arxiv.org/abs/2401.16025},
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
```bibtex
|
|
126
|
+
@inproceedings{anonymous2025flow,
|
|
127
|
+
title = {Flow Policy Gradients for Legged Robots},
|
|
128
|
+
author = {Anonymous},
|
|
129
|
+
booktitle = {Submitted to The Fourteenth International Conference on Learning Representations},
|
|
130
|
+
year = {2025},
|
|
131
|
+
url = {https://openreview.net/forum?id=BA6n0nmagi},
|
|
132
|
+
note = {under review}
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
```bibtex
|
|
137
|
+
@inproceedings{Seitzer2022Pitfalls,
|
|
138
|
+
title = {On the Pitfalls of Heteroscedastic Uncertainty Estimation with Probabilistic Neural Networks},
|
|
139
|
+
author = {Maximilian Seitzer and Abdul-Saboor Sheikh and Georg Martius},
|
|
140
|
+
booktitle = {International Conference on Learning Representations},
|
|
141
|
+
year = {2022},
|
|
142
|
+
url = {https://openreview.net/forum?id=9O_xF9y7A-}
|
|
143
|
+
}
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
```bibtex
|
|
147
|
+
@inproceedings{Wang2025EvolutionaryPO,
|
|
148
|
+
title = {Evolutionary Policy Optimization},
|
|
149
|
+
author = {Jianren Wang and Yifan Su and Abhinav Gupta and Deepak Pathak},
|
|
150
|
+
booktitle = {Advances in Neural Information Processing Systems},
|
|
151
|
+
year = {2025},
|
|
152
|
+
url = {https://arxiv.org/abs/2503.19037}
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
```bibtex
|
|
157
|
+
@misc{osband2026delightfulpolicygradient,
|
|
158
|
+
title = {Delightful Policy Gradient},
|
|
159
|
+
author = {Ian Osband},
|
|
160
|
+
year = {2026},
|
|
161
|
+
eprint = {2603.14608},
|
|
162
|
+
archivePrefix = {arXiv},
|
|
163
|
+
primaryClass = {cs.LG},
|
|
164
|
+
url = {https://arxiv.org/abs/2603.14608},
|
|
165
|
+
}
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
```bibtex
|
|
169
|
+
@misc{eysenbach2018diversityneedlearningskills,
|
|
170
|
+
title = {Diversity is All You Need: Learning Skills without a Reward Function},
|
|
171
|
+
author = {Benjamin Eysenbach and Abhishek Gupta and Julian Ibarz and Sergey Levine},
|
|
172
|
+
year = {2018},
|
|
173
|
+
eprint = {1802.06070},
|
|
174
|
+
archivePrefix = {arXiv},
|
|
175
|
+
primaryClass = {cs.AI},
|
|
176
|
+
url = {https://arxiv.org/abs/1802.06070},
|
|
177
|
+
}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
```bibtex
|
|
181
|
+
@misc{mustafaoglu2025evolutionarypolicyoptimization,
|
|
182
|
+
title = {Evolutionary Policy Optimization},
|
|
183
|
+
author = {Zelal Su "Lain" Mustafaoglu and Keshav Pingali and Risto Miikkulainen},
|
|
184
|
+
year = {2025},
|
|
185
|
+
eprint = {2504.12568},
|
|
186
|
+
archivePrefix = {arXiv},
|
|
187
|
+
primaryClass = {cs.LG},
|
|
188
|
+
url = {https://arxiv.org/abs/2504.12568},
|
|
189
|
+
}
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
```bibtex
|
|
193
|
+
@misc{han2026firefrobeniusisometryreinitializationbalancing,
|
|
194
|
+
title = {FIRE: Frobenius-Isometry Reinitialization for Balancing the Stability-Plasticity Tradeoff},
|
|
195
|
+
author = {Isaac Han and Sangyeon Park and Seungwon Oh and Donghu Kim and Hojoon Lee and Kyung-Joong Kim},
|
|
196
|
+
year = {2026},
|
|
197
|
+
eprint = {2602.08040},
|
|
198
|
+
archivePrefix = {arXiv},
|
|
199
|
+
primaryClass = {cs.LG},
|
|
200
|
+
url = {https://arxiv.org/abs/2602.08040},
|
|
201
|
+
}
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
```bibtex
|
|
205
|
+
@misc{tian2026chunkingcritic,
|
|
206
|
+
title = {Chunking the Critic: A Transformer-based Soft Actor-Critic with N-Step Returns},
|
|
207
|
+
author = {Dong Tian and Onur Celik and Gerhard Neumann},
|
|
208
|
+
year = {2026},
|
|
209
|
+
eprint = {2503.03660},
|
|
210
|
+
archivePrefix = {arXiv},
|
|
211
|
+
primaryClass = {cs.LG},
|
|
212
|
+
url = {https://arxiv.org/abs/2503.03660},
|
|
213
|
+
}
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
```bibtex
|
|
217
|
+
@misc{hahn2025action,
|
|
218
|
+
title = {Action Chunking Proximal Policy Optimization for Universal Robotic Dexterous Grasping},
|
|
219
|
+
author = {Sanghyun Hahn and Jonghyun Choi},
|
|
220
|
+
year = {2025},
|
|
221
|
+
url = {https://openreview.net/forum?id=WFQnqY1c39}
|
|
222
|
+
}
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
```bibtex
|
|
226
|
+
@misc{shin2026adaptiveactionchunkingmultichunk,
|
|
227
|
+
title = {Adaptive Action Chunking via Multi-Chunk Q Value Estimation},
|
|
228
|
+
author = {Yongjae Shin and Jongseong Chae and Seongmin Kim and Jongeui Park and Youngchul Sung},
|
|
229
|
+
year = {2026},
|
|
230
|
+
eprint = {2605.10044},
|
|
231
|
+
archivePrefix = {arXiv},
|
|
232
|
+
primaryClass = {cs.LG},
|
|
233
|
+
url = {https://arxiv.org/abs/2605.10044},
|
|
234
|
+
}
|
|
235
|
+
```
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "x-ppo"
|
|
3
|
+
version = "0.0.1"
|
|
4
|
+
description = "PPO"
|
|
5
|
+
authors = [
|
|
6
|
+
{ name = "Phil Wang", email = "lucidrains@gmail.com" }
|
|
7
|
+
]
|
|
8
|
+
readme = "README.md"
|
|
9
|
+
requires-python = ">= 3.10"
|
|
10
|
+
license = { file = "LICENSE" }
|
|
11
|
+
keywords = [
|
|
12
|
+
'artificial intelligence',
|
|
13
|
+
'deep learning',
|
|
14
|
+
'reinforcement learning',
|
|
15
|
+
'proximal policy optimization'
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
classifiers = [
|
|
19
|
+
'Development Status :: 4 - Beta',
|
|
20
|
+
'Intended Audience :: Developers',
|
|
21
|
+
'Topic :: Scientific/Engineering :: Artificial Intelligence',
|
|
22
|
+
'License :: OSI Approved :: MIT License',
|
|
23
|
+
'Programming Language :: Python :: 3.10',
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
dependencies = [
|
|
27
|
+
"torch>=2.4",
|
|
28
|
+
"torch-einops-utils>=0.1.24",
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
[project.urls]
|
|
32
|
+
Homepage = "https://pypi.org/project/x-ppo/"
|
|
33
|
+
Repository = "https://github.com/lucidrains/x-ppo"
|
|
34
|
+
|
|
35
|
+
[project.optional-dependencies]
|
|
36
|
+
examples = []
|
|
37
|
+
test = [
|
|
38
|
+
"pytest"
|
|
39
|
+
]
|
|
40
|
+
|
|
41
|
+
[tool.pytest.ini_options]
|
|
42
|
+
pythonpath = [
|
|
43
|
+
"."
|
|
44
|
+
]
|
|
45
|
+
|
|
46
|
+
[build-system]
|
|
47
|
+
requires = ["hatchling"]
|
|
48
|
+
build-backend = "hatchling.build"
|
|
49
|
+
|
|
50
|
+
[tool.hatch.metadata]
|
|
51
|
+
allow-direct-references = true
|
|
52
|
+
|
|
53
|
+
[tool.hatch.build]
|
|
54
|
+
include = [
|
|
55
|
+
"x_ppo",
|
|
56
|
+
"pyproject.toml",
|
|
57
|
+
"README.md",
|
|
58
|
+
"LICENSE"
|
|
59
|
+
]
|
|
60
|
+
|
|
61
|
+
[tool.hatch.build.targets.wheel]
|
|
62
|
+
packages = ["x_ppo"]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from x_ppo.ppo import ppo_actor_loss
|
x_ppo-0.0.1/x_ppo/ppo.py
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import torch
|
|
2
|
+
from torch_einops_utils import z_score, masked_mean
|
|
3
|
+
|
|
4
|
+
# helpers
|
|
5
|
+
|
|
6
|
+
def exists(val):
|
|
7
|
+
return val is not None
|
|
8
|
+
|
|
9
|
+
def ppo_actor_loss(
|
|
10
|
+
action_log_probs,
|
|
11
|
+
old_action_log_probs,
|
|
12
|
+
advantages,
|
|
13
|
+
eps_clip = 0.2,
|
|
14
|
+
mask = None,
|
|
15
|
+
normalize_advantages = False
|
|
16
|
+
):
|
|
17
|
+
if normalize_advantages:
|
|
18
|
+
advantages = z_score(advantages, mask = mask)
|
|
19
|
+
|
|
20
|
+
ratios = (action_log_probs - old_action_log_probs).exp()
|
|
21
|
+
|
|
22
|
+
surr1 = ratios * advantages
|
|
23
|
+
surr2 = ratios.clamp(1. - eps_clip, 1. + eps_clip) * advantages
|
|
24
|
+
|
|
25
|
+
loss = - torch.min(surr1, surr2)
|
|
26
|
+
|
|
27
|
+
if not exists(mask):
|
|
28
|
+
return loss
|
|
29
|
+
|
|
30
|
+
return masked_mean(loss, mask = mask)
|