Gymnasium API for Reinforcement Learning.
The workspace contains these packages:
Add gymnasium
as a Rust dependency to your Cargo.toml
manifest.
toml
[dependencies]
gymnasium = { git = "https://github.com/AndrejOrsula/gymnasium_rs.git" }
Examples: gymnasium/examples/
The Python module requires Rust and Cargo to compile extensions. Install them through your package manager or via https://rustup.rs.
Compile and install the gymnasium
Python module by installing this project with pip
.
bash
pip3 install git+https://github.com/AndrejOrsula/gymnasium_rs.git
Examples: gymnasium_py/examples/
After cloning the repository, use cargo
to run the gymnasium_cli
binary.
```bash
--help
to show the usage and available optionscargo run --release --bin gymnasium_cli -- --help ```
Rust examples can be run with cargo
. Python examples can be directly interpreted.
```bash
cargo run --release --example ${EXAMPLE}
python3 gymnasium_py/examples/${EXAMPLE}.py ```
Tests and benchmarks can be run with cargo
.
Python tests require
pytest
(can be installed as an optional dependency withpip3 install .[test]
).
```bash
--features python
enables Python tests with pytest
)cargo test --features python
cargo bench ```
To install Docker on your system, you can run
install_docker.bash
to configure Docker with NVIDIA GPU support (only for Debian-based distributions).
bash .docker/host/install_docker.bash
To build a new Docker image from Dockerfile, you can run build.bash
as shown below.
bash
.docker/build.bash ${TAG:-latest} ${BUILD_ARGS}
To run the Docker container, you can use run.bash
as shown below.
bash
.docker/run.bash ${TAG:-latest} ${CMD}
To run the Docker container in a development mode (source code mounted as a volume), you can use dev.bash
as shown below.
bash
.docker/dev.bash ${TAG:-latest} ${CMD}
As an alternative for VS Code users familiar with Dev Containers, you can modify the included devcontainer.json
to your needs.
To join a running Docker container from another terminal, you can use join.bash
as shown below.
bash
.docker/join.bash ${CMD:-bash}
This project is dual-licensed to be compatible with the Rust project, under either the MIT or Apache 2.0 licenses.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.