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.14.tar.gz
(372.5 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.14.tar.gz.
File metadata
- Download URL: contrastive_rl_pytorch-0.0.14.tar.gz
- Upload date:
- Size: 372.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4cdbc268f2618b7af57b95c6995fbfef816305d05e8e8a7f2e48967b2a7d4798
|
|
| MD5 |
cfc33fb804d4f0e3d7a0ac0ea251682c
|
|
| BLAKE2b-256 |
cd1662e7f121af33fedf1c9036ae8213f690f0826c194cd0914b245a51866e20
|
File details
Details for the file contrastive_rl_pytorch-0.0.14-py3-none-any.whl.
File metadata
- Download URL: contrastive_rl_pytorch-0.0.14-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 |
9fd04a9dff3ec5cf54b1a2553d71db989088408d22988053d3c12a90b558674a
|
|
| MD5 |
2eb48ceeb88bb45995b70ac699d51011
|
|
| BLAKE2b-256 |
f8cae1b7d86dbc0c201e92db46e6a1fdd8717e8348533f1264a5b0efa2ada868
|