{"id":42204658,"url":"https://github.com/dcbr/dualcrl","last_synced_at":"2026-01-27T00:31:44.816Z","repository":{"id":289692786,"uuid":"972104219","full_name":"dcbr/dualcrl","owner":"dcbr","description":"This repository provides the necessary code to reproduce all experiments of the paper \"A Dual Perspective of Reinforcement Learning for Imposing Policy Constraints\" [1].","archived":false,"fork":false,"pushed_at":"2025-07-07T09:48:16.000Z","size":30,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-05T07:46:52.801Z","etag":null,"topics":["constraints","duality","reinforcement-learning"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dcbr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.bib","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-04-24T14:40:21.000Z","updated_at":"2025-07-07T09:48:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"7d92c672-3e37-466a-afd3-4979d971dc97","html_url":"https://github.com/dcbr/dualcrl","commit_stats":null,"previous_names":["dcbr/dualcrl"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dcbr/dualcrl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcbr%2Fdualcrl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcbr%2Fdualcrl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcbr%2Fdualcrl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcbr%2Fdualcrl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dcbr","download_url":"https://codeload.github.com/dcbr/dualcrl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcbr%2Fdualcrl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28793349,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T21:49:50.245Z","status":"ssl_error","status_checked_at":"2026-01-26T21:48:29.455Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["constraints","duality","reinforcement-learning"],"created_at":"2026-01-27T00:31:44.756Z","updated_at":"2026-01-27T00:31:44.808Z","avatar_url":"https://github.com/dcbr.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dual Constrained Reinforcement Learning\nThis repository provides the necessary code to reproduce all experiments of the paper *\"A Dual Perspective of Reinforcement Learning for Imposing Policy Constraints\"* [1].\n\nAn example [Pytorch](https://pytorch.org) implementation of the \u003ctt\u003eDualCRL\u003c/tt\u003e algorithm is provided, with support for any combination of entropy regularization, value constraints, density constraints and transition constraints.\nCustom constrained setups are defined for the `CliffWalking-v0` and `Pendulum-v1` [Gymnasium environments](https://gymnasium.farama.org).\nFurther details are provided in the paper's Experiments section.\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd\u003e\n\nhttps://github.com/user-attachments/assets/c3c32c2c-3ba0-4098-9580-9a8216c3246e\n\n\u003c/td\u003e\n\u003ctd\u003e\n\nhttps://github.com/user-attachments/assets/94a3130d-e4f7-4458-91b1-43e7442f4226\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n## Installation\n1. Clone this repository.\n\n   ``git clone https://github.com/dcbr/dualcrl``\n\n   ``cd dualcrl``\n\n2. Install the required packages, as specified in `environment.yml`.\n   This can be easily done by creating a virtual environment (using e.g. conda or venv).\n\n   ``conda env create -f environment.yml``\n\n## Usage\nActivate the virtual environment, using e.g. `conda activate dualcrl`. Afterwards, you can simply run the `main` script with suitable arguments to train the models or analyze their performance.\nFor example\n\n``python main.py --mode train --job cliffwalk``\n\nto train on the cliff walking environment (with additional policy constraints).\n\nTo reproduce all results of Section VI, first train on all jobs with ``python main.py --mode train --job [JOB] --uid paper``, followed by the analysis ``python main.py --mode analyze --job [JOB] --uid paper``. Beware that this might take a while to complete, depending on your hardware!\n\nA summary of the most relevant parameters to this script is provided below.\nCheck ``python main.py --help`` for a full overview of supported parameters.\n\n| Parameter | Supported values        | Description                                                                   |\n|:----------|:------------------------|:------------------------------------------------------------------------------|\n| `--mode`  | `train`, `analyze`      | Run mode. Either train models, or analyze (and summarize) the results.        |\n| `--job`   | `cliffwalk`, `pendulum` | Job to run. The job file defines the environment and constraints to train on. |\n| `--uid`   | Any value               | Unique identifier for a job run.                                              |\n\n## References\n[1] De Cooman, B., Suykens, J.: A Dual Perspective of Reinforcement Learning for Imposing Policy Constraints. Accepted for publication in *IEEE Transactions on Artificial Intelligence*. DOI: [10.1109/TAI.2025.3564898](https://doi.org/10.1109/TAI.2025.3564898), ArXiv: [2404.16468](https://arxiv.org/abs/2404.16468)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcbr%2Fdualcrl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdcbr%2Fdualcrl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcbr%2Fdualcrl/lists"}