{"id":42204650,"url":"https://github.com/dcbr/sdab","last_synced_at":"2026-01-27T00:31:43.952Z","repository":{"id":37556384,"uuid":"505962881","full_name":"dcbr/sdab","owner":"dcbr","description":"This repository provides the necessary code to reproduce all supplementary experiments of the \"Enforcing Hard State-Dependent Action Bounds on Deep Reinforcement Learning Policies\" paper [1, Appendix B].","archived":false,"fork":false,"pushed_at":"2022-06-21T18:47:01.000Z","size":31,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-05T08:41:01.147Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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}},"created_at":"2022-06-21T18:37:34.000Z","updated_at":"2024-10-24T12:25:35.000Z","dependencies_parsed_at":"2022-08-27T13:54:27.999Z","dependency_job_id":null,"html_url":"https://github.com/dcbr/sdab","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dcbr/sdab","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcbr%2Fsdab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcbr%2Fsdab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcbr%2Fsdab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcbr%2Fsdab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dcbr","download_url":"https://codeload.github.com/dcbr/sdab/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcbr%2Fsdab/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":[],"created_at":"2026-01-27T00:31:43.894Z","updated_at":"2026-01-27T00:31:43.947Z","avatar_url":"https://github.com/dcbr.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# State-dependent action bounds\nThis repository provides the necessary code to reproduce all supplementary experiments of the *\"Enforcing Hard State-Dependent Action Bounds on Deep Reinforcement Learning Policies\"* paper [1, Appendix B].\n\nAn example implementation of state-dependent action bounds is provided for the SAC method, using [Stable-Baselines3](https://github.com/DLR-RM/stable-baselines3) and [Pytorch](https://pytorch.org).\nCustom state-dependent action bounds are defined for the `Pendulum-v1` and `LunarLanderContinuous-v2` [OpenAI gym environments](https://gymlibrary.ml).\nRefer to the paper's supplementary material for further details.\n\n# Installation\n\n1. Clone this repository.\n\n   ``git clone https://github.com/dcbr/sdab``\n\n   ``cd sdab``\n\n2. Install the required packages.\n   Optionally, create a virtual environment first (using e.g. conda or venv).\n\n   ``python -m pip install -r requirements.txt``\n\n# Usage\n\nRun the `action_bounds` script with suitable arguments to train the models or evaluate and analyze their performance.\nFor example\n\n``python action_bounds.py --mode train --envs LunarLanderContinuous-v2 --rescale lin hyp``\n\nto train on the lunar lander environment (with stabilizing action bounds) for both the linear and hyperbolic rescaling function.\n\nTo reproduce all results of Appendix B, first train all models with ``python action_bounds.py``, followed by the analysis ``python action_bounds.py --mode analyze``. 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 action_bounds.py --help`` for a full overview of supported parameters.\n\n| Parameter   | Supported values                          | Description                                                                                                                                                                                                |\n|:------------|:------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `--mode`    | `train`, `eval`, `analyze`                | Run mode. Either train models, evaluate (and visualize) them or analyze and summarize the results (creating the plots shown in the paper).                                                                 |\n| `--envs`    | `Pendulum-v1`, `LunarLanderContinuous-v2` | OpenAI gym environment ID.                                                                                                                                                                                 |\n| `--algs`    | `sac`, `bsac`                             | Reinforcement learning algorithm to use. Either the bounded SAC algorithm (`bsac`), with enforced state-dependent action bounds, or the default SAC algorithm (`sac`), without enforcement of such bounds. |\n| `--rescale` | `lin`, `pwl`, `hyp`, `clip`               | Rescaling function \u0026sigma; to use. Either linear (`lin`), piecewise linear (`pwl`) or hyperbolic (`hyp`) rescaling; or clipping (`clip`).                                                                  |\n| `--seeds`   | Any integer number *N*                    | Experiments are repeated for all of the provided seeds. Can also be a negative number *-N* in which case *N* seeds are randomly chosen.                                                                    |\n\n# References\n\n[1] De Cooman, B., Suykens, J., Ortseifen, A.: Enforcing hard state-dependent action bounds on deep reinforcement learning policies. Accepted for *8th International Conference on Machine Learning, Optimization \u0026 Data Science, LOD 2022*.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcbr%2Fsdab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdcbr%2Fsdab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcbr%2Fsdab/lists"}