Name | contrastive-rl-pytorch JSON |
Version |
0.0.10
JSON |
| download |
home_page | None |
Summary | Contrastive RL |
upload_time | 2025-09-02 15:07:43 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.9 |
license | MIT License
Copyright (c) 2025 Phil Wang
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. |
keywords |
artificial intelligence
deep learning
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
<img src="./crtr.png" width="450px"></img>
## contrastive-rl (wip)
For following a [new line of research](https://arxiv.org/abs/2206.07568) that started in 2022 from [Eysenbach](https://ben-eysenbach.github.io/) et al.
## install
```shell
$ pip install contrastive-rl-pytorch
```
## usage
```python
import torch
from contrastive_rl_pytorch import ContrastiveRLTrainer
from x_mlps_pytorch import MLP
encoder = MLP(16, 256, 128)
trainer = ContrastiveRLTrainer(encoder)
trajectories = torch.randn(256, 512, 16)
trainer(trajectories, 100)
# train for 100 steps and save
torch.save(encoder.state_dict(), './trained.pt')
```
## citations
```bibtex
@misc{eysenbach2023contrastivelearninggoalconditionedreinforcement,
title = {Contrastive Learning as Goal-Conditioned Reinforcement Learning},
author = {Benjamin Eysenbach and Tianjun Zhang and Ruslan Salakhutdinov and Sergey Levine},
year = {2023},
eprint = {2206.07568},
archivePrefix = {arXiv},
primaryClass = {cs.LG},
url = {https://arxiv.org/abs/2206.07568},
}
```
```bibtex
@misc{ziarko2025contrastiverepresentationstemporalreasoning,
title = {Contrastive Representations for Temporal Reasoning},
author = {Alicja Ziarko and Michal Bortkiewicz and Michal Zawalski and Benjamin Eysenbach and Piotr Milos},
year = {2025},
eprint = {2508.13113},
archivePrefix = {arXiv},
primaryClass = {cs.LG},
url = {https://arxiv.org/abs/2508.13113},
}
```
Raw data
{
"_id": null,
"home_page": null,
"name": "contrastive-rl-pytorch",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "artificial intelligence, deep learning",
"author": null,
"author_email": "Phil Wang <lucidrains@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/d4/40/1bf7ca963347c6b4d5387e0dc30de5853c293a22e934ca56ffbf688732af/contrastive_rl_pytorch-0.0.10.tar.gz",
"platform": null,
"description": "<img src=\"./crtr.png\" width=\"450px\"></img>\n\n## contrastive-rl (wip)\n\nFor following a [new line of research](https://arxiv.org/abs/2206.07568) that started in 2022 from [Eysenbach](https://ben-eysenbach.github.io/) et al.\n\n## install\n\n```shell\n$ pip install contrastive-rl-pytorch\n```\n\n## usage\n\n```python\nimport torch\nfrom contrastive_rl_pytorch import ContrastiveRLTrainer\nfrom x_mlps_pytorch import MLP\n\nencoder = MLP(16, 256, 128)\n\ntrainer = ContrastiveRLTrainer(encoder)\n\ntrajectories = torch.randn(256, 512, 16)\n\ntrainer(trajectories, 100)\n\n# train for 100 steps and save\n\ntorch.save(encoder.state_dict(), './trained.pt')\n```\n\n## citations\n\n```bibtex\n@misc{eysenbach2023contrastivelearninggoalconditionedreinforcement,\n title = {Contrastive Learning as Goal-Conditioned Reinforcement Learning}, \n author = {Benjamin Eysenbach and Tianjun Zhang and Ruslan Salakhutdinov and Sergey Levine},\n year = {2023},\n eprint = {2206.07568},\n archivePrefix = {arXiv},\n primaryClass = {cs.LG},\n url = {https://arxiv.org/abs/2206.07568}, \n}\n```\n\n```bibtex\n@misc{ziarko2025contrastiverepresentationstemporalreasoning,\n title = {Contrastive Representations for Temporal Reasoning}, \n author = {Alicja Ziarko and Michal Bortkiewicz and Michal Zawalski and Benjamin Eysenbach and Piotr Milos},\n year = {2025},\n eprint = {2508.13113},\n archivePrefix = {arXiv},\n primaryClass = {cs.LG},\n url = {https://arxiv.org/abs/2508.13113}, \n}\n```\n",
"bugtrack_url": null,
"license": "MIT License\n \n Copyright (c) 2025 Phil Wang\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.",
"summary": "Contrastive RL",
"version": "0.0.10",
"project_urls": {
"Homepage": "https://pypi.org/project/contrastive-rl/",
"Repository": "https://github.com/lucidrains/contrastive-rl"
},
"split_keywords": [
"artificial intelligence",
" deep learning"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "65a24453f0bfb894cba5a34b06f3b6ec79dc9346ebaab4c9a2c15c78c926b49a",
"md5": "492cf422c747a0df0b4fa659ec1dfb6d",
"sha256": "78598184f3d578183ffbf43c5b3659ae07ad0b0732c6631f5c0da041430c2755"
},
"downloads": -1,
"filename": "contrastive_rl_pytorch-0.0.10-py3-none-any.whl",
"has_sig": false,
"md5_digest": "492cf422c747a0df0b4fa659ec1dfb6d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 3394,
"upload_time": "2025-09-02T15:07:41",
"upload_time_iso_8601": "2025-09-02T15:07:41.759265Z",
"url": "https://files.pythonhosted.org/packages/65/a2/4453f0bfb894cba5a34b06f3b6ec79dc9346ebaab4c9a2c15c78c926b49a/contrastive_rl_pytorch-0.0.10-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "d4401bf7ca963347c6b4d5387e0dc30de5853c293a22e934ca56ffbf688732af",
"md5": "51177f6bca9d1d492f72c37773d8fc7c",
"sha256": "70ea1459bcb5f48d215c455b1ee81cafd4ab632017213ca8c769f18fab60807a"
},
"downloads": -1,
"filename": "contrastive_rl_pytorch-0.0.10.tar.gz",
"has_sig": false,
"md5_digest": "51177f6bca9d1d492f72c37773d8fc7c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 371541,
"upload_time": "2025-09-02T15:07:43",
"upload_time_iso_8601": "2025-09-02T15:07:43.042223Z",
"url": "https://files.pythonhosted.org/packages/d4/40/1bf7ca963347c6b4d5387e0dc30de5853c293a22e934ca56ffbf688732af/contrastive_rl_pytorch-0.0.10.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-09-02 15:07:43",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "lucidrains",
"github_project": "contrastive-rl",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "contrastive-rl-pytorch"
}