Contrastive RL
Project description
contrastive-rl (wip)
For following a new line of research that started in 2022 from Eysenbach et al.
install
$ pip install contrastive-rl-pytorch
usage
import torch
from contrastive_rl_pytorch import ContrastiveRLTrainer
from x_mlps_pytorch.residual_normed_mlp import ResidualNormedMLP
encoder = ResidualNormedMLP(dim = 256, dim_in = 16, dim_out = 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
@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},
}
@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},
}
@inproceedings{anonymous2025hierarchical,
title = {Hierarchical Contrastive Reinforcement Learning: learn representation more suitable for {RL} environments},
author = {Anonymous},
booktitle = {Submitted to The Fourteenth International Conference on Learning Representations},
year = {2025},
url = {https://openreview.net/forum?id=rTCSFOzVcK},
note = {under review}
}
@misc{liu2024singlegoalneedskills,
title = {A Single Goal is All You Need: Skills and Exploration Emerge from Contrastive RL without Rewards, Demonstrations, or Subgoals},
author = {Grace Liu and Michael Tang and Benjamin Eysenbach},
year = {2024},
eprint = {2408.05804},
archivePrefix = {arXiv},
primaryClass = {cs.LG},
url = {https://arxiv.org/abs/2408.05804},
}
@inproceedings{anonymous2025demystifying,
title = {Demystifying Emergent Exploration in Goal-Conditioned {RL}},
author = {Anonymous},
booktitle = {Submitted to The Fourteenth International Conference on Learning Representations},
year = {2025},
url = {https://openreview.net/forum?id=mwgYORsqtv},
note = {under review}
}
@inproceedings{wang2025,
title = {1000 Layer Networks for Self-Supervised {RL}: Scaling Depth Can Enable New Goal-Reaching Capabilities},
author = {Kevin Wang and Ishaan Javali and Micha{\l} Bortkiewicz and Tomasz Trzcinski and Benjamin Eysenbach},
booktitle = {The Thirty-ninth Annual Conference on Neural Information Processing Systems},
year = {2025},
url = {https://openreview.net/forum?id=s0JVsx3bx1}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
contrastive_rl_pytorch-0.0.15.tar.gz
(372.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file contrastive_rl_pytorch-0.0.15.tar.gz.
File metadata
- Download URL: contrastive_rl_pytorch-0.0.15.tar.gz
- Upload date:
- Size: 372.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a9f905d22264ec9fa77ba9536f771976fe17e1561c850ff45e9f1bb122df6d4
|
|
| MD5 |
975643a815778e54dad3c06522a29382
|
|
| BLAKE2b-256 |
0079a01807e443cb6bb592ef81de9b57e022fec680b385542c07ae0aa83d23b7
|
File details
Details for the file contrastive_rl_pytorch-0.0.15-py3-none-any.whl.
File metadata
- Download URL: contrastive_rl_pytorch-0.0.15-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f39a17520c0e1bc903c5f92440be1627fbbb0e014f672a8c3809777eff80157
|
|
| MD5 |
8898be48e26f392d098ba72169204f5c
|
|
| BLAKE2b-256 |
b031dc1a665e5b0e6073877e018c260be7dbeafe9db9ce3d2c899d51588f76fc
|